mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
{% func RecentChangesHTML(changes []string, n int) %}
|
|
<main class="recent-changes">
|
|
<h1>Recent Changes</h1>
|
|
<p><a href="/">← Back</a></p>
|
|
|
|
<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>
|
|
|
|
{% 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 %}
|
|
<ul class="recent-changes__entry rc-entry" role="article"
|
|
aria-setsize="{%d n %}" aria-posinset="{%d i %}">
|
|
{%s= entry %}
|
|
</ul>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</section>
|
|
</main>
|
|
{% endfunc %}
|