1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 19:56:16 +00:00
mycorrhiza/templates/recent_changes.qtpl

46 lines
1.4 KiB
Plaintext
Raw Normal View History

2020-09-26 18:19:17 +00:00
{% func RecentChangesHTML(changes []string, n int) %}
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width recent-changes">
2020-09-26 18:19:17 +00:00
<h1>Recent Changes</h1>
2020-11-04 11:00:17 +00:00
<p><a href="/">← Back</a></p>
2020-09-26 18:19:17 +00:00
<nav class="recent-changes__count">
See
{% for _, m := range []int{20, 0, 50, 0, 100} %}
{% switch m %}
{% case 0 %}
<span aria-hidden="true">|</span>
{% case n %}
<b>{%d n %}</b>
{% default %}
<a href="/recent-changes/{%d m %}">{%d m %}</a>
{% endswitch %}
{% endfor %}
recent changes
</nav>
<p><img class="icon" width="20" height="20" src="https://upload.wikimedia.org/wikipedia/commons/4/46/Generic_Feed-icon.svg">Subscribe via <a href="/recent-changes-rss">RSS</a>, <a href="/recent-changes-atom">Atom</a> or <a href="/recent-changes-json">JSON feed</a>.</p>
2020-09-26 18:19:17 +00:00
{% comment %}
Here I am, willing to add some accesibility using ARIA. Turns out,
role="feed" is not supported in any screen reader as of September
2020. At least web search says so. Even JAWS doesn't support it!
How come? I'll add the role anyway. -- bouncepaw
{% endcomment %}
<section class="recent-changes__list" role="feed">
{% if len(changes) == 0 %}
<p>Could not find any recent changes.</p>
{% else %}
{% for i, entry := range changes %}
2020-11-04 11:00:17 +00:00
<ul class="recent-changes__entry rc-entry" role="article"
2020-09-26 18:19:17 +00:00
aria-setsize="{%d n %}" aria-posinset="{%d i %}">
{%s= entry %}
</ul>
{% endfor %}
{% endif %}
</section>
</main>
2021-01-26 05:41:57 +00:00
</div>
2020-09-26 18:19:17 +00:00
{% endfunc %}