moviewyrm/bookwyrm/templates/snippets/table-sort-header.html

14 lines
528 B
HTML
Raw Normal View History

2021-03-28 20:36:05 +00:00
{% load i18n %}
<a href="{{ url }}?sort={% if sort == field %}-{% endif %}{{ field }}{% for k, v in request.GET.items %}{% if k != "sort" %}&{{ k }}={{ v }}{% endif %}{% endfor %}">
2021-03-28 20:36:05 +00:00
{{ text }}
{% if sort == field %}
2021-03-28 21:20:49 +00:00
<span class="icon icon-arrow-up">
2021-03-28 20:36:05 +00:00
<span class="is-sr-only">{% trans "Sorted asccending" %}</span>
</span>
{% elif sort == "-"|add:field %}
2021-03-28 21:20:49 +00:00
<span class="icon icon-arrow-down">
2021-03-28 20:36:05 +00:00
<span class="is-sr-only">{% trans "Sorted descending" %}</span>
</span>
{% endif %}
</a>