1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 11:46:16 +00:00
mycorrhiza/templates/stuff.qtpl

83 lines
2.3 KiB
Plaintext
Raw Normal View History

{% import "github.com/bouncepaw/mycorrhiza/util" %}
{% import "github.com/bouncepaw/mycorrhiza/user" %}
2021-01-24 07:30:14 +00:00
{% func BaseHTML(title, body string, u *user.User, headElements ...string) %}
2020-08-31 17:52:26 +00:00
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/static/common.css">
<title>{%s title %}</title>
2020-12-17 12:59:59 +00:00
{% for _, el := range headElements %}{%s= el %}{% endfor %}
2020-08-31 17:52:26 +00:00
</head>
<body>
2021-01-23 19:00:58 +00:00
<header>
2021-01-25 18:37:21 +00:00
<nav class="header-links main-width">
2021-01-23 19:00:58 +00:00
<ul class="header-links__list">
{%- for _, link := range util.HeaderLinks -%}
<li class="header-links__entry"><a class="header-links__link" href="{%s link.Href %}">{%s link.Display %}</a></li>
{%- endfor -%}
2021-01-24 07:30:14 +00:00
{%s= userMenuHTML(u) %}
2021-01-23 19:00:58 +00:00
</ul>
</nav>
</header>
2020-08-31 17:52:26 +00:00
{%s= body %}
</body>
</html>
{% endfunc %}
2020-08-31 18:16:22 +00:00
{% func HyphaListHTML(tbody string, pageCount int) %}
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width">
2020-08-31 18:16:22 +00:00
<h1>List of hyphae</h1>
<p>This wiki has {%d pageCount %} hyphae.</p>
2020-08-31 17:52:26 +00:00
<table>
<thead>
<tr>
2020-08-31 18:16:22 +00:00
<th>Full name</th>
<th>Binary part type</th>
2020-08-31 17:52:26 +00:00
</tr>
</thead>
<tbody>
{%s= tbody %}
</tbody>
</table>
</main>
2021-01-26 05:41:57 +00:00
</div>
2020-08-31 17:52:26 +00:00
{% endfunc %}
2020-08-31 18:16:22 +00:00
{% func HyphaListRowHTML(hyphaName, binaryMime string, binaryPresent bool) %}
<tr>
<td><a href="/page/{%s hyphaName %}">{%s hyphaName %}</a></td>
{% if binaryPresent %}
<td>{%s binaryMime %}</td>
{% else %}
<td></td>
{% endif %}
</tr>
{% endfunc %}
{% func AboutHTML() %}
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width">
<section>
<h1>About {%s util.SiteName %}</h1>
<ul>
2021-01-24 12:52:40 +00:00
<li><b><a href="https://mycorrhiza.lesarbr.es">MycorrhizaWiki</a> version:</b> β 0.13 indev</li>
{%- if user.AuthUsed -%}
<li><b>User count:</b> {%d user.Count() %}</li>
<li><b>Home page:</b> <a href="/">{%s util.HomePage %}</a></li>
<li><b>Administrators:</b> {%- for i, username := range user.ListUsersWithGroup("admin") -%}
{%- if i > 0 -%}<span aria-hidden="true">, </span>
{%- endif -%}
2021-01-23 16:37:29 +00:00
<a href="/page/{%s util.UserHypha %}/{%s username %}">{%s username %}</a>{%- endfor -%}</li>
{%- else -%}
<li>This wiki does not use authorization</li>
{%- endif -%}
</ul>
<p>See <a href="/list">/list</a> for information about hyphae on this wiki.</p>
</section>
</main>
2021-01-26 05:41:57 +00:00
</div>
{% endfunc %}