forked from mirrors/bookwyrm
Hides disabled pagination links for screenreaders
This commit is contained in:
parent
8d7527dee3
commit
b3535d9a90
1 changed files with 18 additions and 4 deletions
|
@ -1,12 +1,26 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<nav class="pagination" aria-label="pagination">
|
<nav class="pagination" aria-label="pagination">
|
||||||
<a class="pagination-previous {% if not page.has_previous %}is-disabled{% endif %}" {% 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 }}"{% endif %}>
|
<a
|
||||||
<span class="icon icon-arrow-left"></span>
|
class="pagination-previous {% if not page.has_previous %}is-disabled{% endif %}"
|
||||||
|
{% 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 %}
|
||||||
|
aria-hidden="true"
|
||||||
|
{% endif %}>
|
||||||
|
|
||||||
|
<span class="icon icon-arrow-left" aria-hidden="true"></span>
|
||||||
{% trans "Previous" %}
|
{% trans "Previous" %}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="pagination-next {% if not page.has_next %}is-disabled{% endif %}" {% 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 }}"{% endif %}>
|
<a
|
||||||
|
class="pagination-next {% if not page.has_next %}is-disabled{% endif %}"
|
||||||
|
{% 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 %}
|
||||||
|
aria-hidden="true"
|
||||||
|
{% endif %}>
|
||||||
|
|
||||||
{% trans "Next" %}
|
{% trans "Next" %}
|
||||||
<span class="icon icon-arrow-right"></span>
|
<span class="icon icon-arrow-right" aria-hidden="true"></span>
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Reference in a new issue