mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 01:50:34 +00:00
Merge pull request #862 from mouse-reeve/disabled-link
Valid html solution to disabling pagination links
This commit is contained in:
commit
abd6a78295
2 changed files with 28 additions and 4 deletions
|
@ -25,6 +25,16 @@ html {
|
|||
min-width: 75% !important;
|
||||
}
|
||||
|
||||
/* --- "disabled" for non-buttons --- */
|
||||
.is-disabled {
|
||||
background-color: #dbdbdb;
|
||||
border-color: #dbdbdb;
|
||||
box-shadow: none;
|
||||
color: #7a7a7a;
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* --- SHELVING --- */
|
||||
|
||||
/** @todo Replace icons with SVG symbols.
|
||||
|
|
|
@ -1,12 +1,26 @@
|
|||
{% load i18n %}
|
||||
<nav class="pagination" aria-label="pagination">
|
||||
<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 %}>
|
||||
<span class="icon icon-arrow-left"></span>
|
||||
<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 }}"
|
||||
{% else %}
|
||||
aria-hidden="true"
|
||||
{% endif %}>
|
||||
|
||||
<span class="icon icon-arrow-left" aria-hidden="true"></span>
|
||||
{% trans "Previous" %}
|
||||
</a>
|
||||
|
||||
<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 %}>
|
||||
<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" %}
|
||||
<span class="icon icon-arrow-right"></span>
|
||||
<span class="icon icon-arrow-right" aria-hidden="true"></span>
|
||||
</a>
|
||||
</nav>
|
||||
|
|
Loading…
Reference in a new issue