Merge pull request #854 from mouse-reeve/pagination-placeholders

Show disabled placeholders in pagination
This commit is contained in:
Mouse Reeve 2021-04-02 10:05:01 -07:00 committed by GitHub
commit 19a13bdb56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 16 deletions

View File

@ -1,20 +1,12 @@
{% load i18n %} {% load i18n %}
<nav class="pagination" aria-label="pagination"> <nav class="pagination" aria-label="pagination">
{% if page.has_previous %} <a class="pagination-previous" {% if page.has_previous %}href="{{ path }}?{% for k, v in request.GET.items %}{% if k != 'page' %}{{ k }}={{ v }}&{% endif %}{% endfor %}page={{ page.previous_page_number }}{{ anchor }}" {% else %}disabled{% endif %}>
<p class="pagination-previous">
<a href="{{ path }}?{% for k, v in request.GET.items %}{% if k != 'page' %}{{ k }}={{ v }}&{% endif %}{% endfor %}page={{ page.previous_page_number }}{{ anchor }}">
<span class="icon icon-arrow-left"></span> <span class="icon icon-arrow-left"></span>
{% trans "Previous" %} {% trans "Previous" %}
</a> </a>
</p>
{% endif %}
{% if page.has_next %} <a class="pagination-next" {% if page.has_next %}href="{{ path }}?{% for k, v in request.GET.items %}{% if k != 'page' %}{{ k }}={{ v }}&{% endif %}{% endfor %}page={{ page.next_page_number }}{{ anchor }}"{% else %} disabled{% endif %}>
<p class="pagination-next">
<a href="{{ path }}?{% for k, v in request.GET.items %}{% if k != 'page' %}{{ k }}={{ v }}&{% endif %}{% endfor %}page={{ page.next_page_number }}{{ anchor }}">
{% trans "Next" %} {% trans "Next" %}
<span class="icon icon-arrow-right"></span> <span class="icon icon-arrow-right"></span>
</a> </a>
</p>
{% endif %}
</nav> </nav>