forked from mirrors/bookwyrm
Sort and filter mutually respect each other
This commit is contained in:
parent
634509a7f3
commit
62bd744b69
2 changed files with 5 additions and 2 deletions
|
@ -11,7 +11,10 @@
|
|||
</span>
|
||||
</h2>
|
||||
|
||||
<form class="hidden mt-3" id="filters" method-"get" action="{{ request.path }}" tabindex="0">
|
||||
<form class="hidden mt-3" id="filters" method="get" action="{{ request.path }}" tabindex="0">
|
||||
{% if sort %}
|
||||
<input type="hidden" name="sort" value="{{ sort }}">
|
||||
{% endif %}
|
||||
<div class="columns">
|
||||
{% block filter_fields %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% load i18n %}
|
||||
<a href="{{ url }}?sort={% if sort == field %}-{% endif %}{{ field }}">
|
||||
<a href="{{ url }}?sort={% if sort == field %}-{% endif %}{{ field }}{% for k, v in request.GET.items %}{% if k != "sort" %}&{{ k }}={{ v }}{% endif %}{% endfor %}">
|
||||
{{ text }}
|
||||
{% if sort == field %}
|
||||
<span class="icon icon-arrow-up">
|
||||
|
|
Loading…
Reference in a new issue