diff options
Diffstat (limited to 'pydis_site/templates/wiki/includes/pagination.html')
-rw-r--r-- | pydis_site/templates/wiki/includes/pagination.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pydis_site/templates/wiki/includes/pagination.html b/pydis_site/templates/wiki/includes/pagination.html new file mode 100644 index 00000000..bd113dd6 --- /dev/null +++ b/pydis_site/templates/wiki/includes/pagination.html @@ -0,0 +1,26 @@ +{% load i18n %} +{% if is_paginated %} + <nav class="pagination" role="navigation" aria-label="pagination"> + {% if page_obj.has_previous %} + <a class="pagination-previous" href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ page_obj.previous_page_number }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">Previous</a> + {% else %} + <a class="pagination-previous tooltip" data-tooltip="This is the first page" disabled>Previous</a> + {% endif %} + + {% if page_obj.has_next %} + <a class="pagination-next" href="{% if search_query %}q={{ search_query }}&{% endif %}page={{ page_obj.next_page_number }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">Next</a> + {% else %} + <a class="pagination-next tooltip" data-tooltip="This is the last page" disabled>Older</a> + {% endif %} + + <ul class="pagination-list"> + {% for pc in paginator.page_range %} + {% if pc == 0 %} + <li><span class="pagination-ellipsis">…</span></li> + {% else %} + <li><a class="pagination-link{% if pc == page_obj.number %} is-current{% endif %}" href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ pc }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">{{ pc }}</a></li> + {% endif %} + {% endfor %} + </ul> + </nav> +{% endif %} |