aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/includes
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-19 12:11:49 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-19 12:11:49 +0100
commited7ba6aa8ebe02d8e16fc784ece95d6092c4701b (patch)
tree0b3ff2a1ad55c373b290c14ef5d5ab1e5fad0476 /pydis_site/templates/wiki/includes
parentBig pagination changes because the wiki is stupid (diff)
Wiki pagination is special-cased, so we basically have one option for it
Diffstat (limited to 'pydis_site/templates/wiki/includes')
-rw-r--r--pydis_site/templates/wiki/includes/pagination.html26
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">&hellip;</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 %}