aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/includes/pagination.html
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site/templates/wiki/includes/pagination.html')
-rw-r--r--pydis_site/templates/wiki/includes/pagination.html24
1 files changed, 24 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..6e7ec608
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/pagination.html
@@ -0,0 +1,24 @@
+{% load i18n %}
+{% if is_paginated %}
+<ul class="pagination">
+ {% if page_obj.has_previous %}
+ <li><a class="prev btn btn-info" href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ page_obj.previous_page_number }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">&laquo;</a></li>
+ {% else %}
+ <li class="disabled"><span>&laquo;</span></li>
+ {% endif %}
+
+ {% for pc in paginator.page_range %}
+ {% if pc == 0 %}
+ <li class="disabled"><span>...</span></li>
+ {% else %}
+ <li class="{% if pc == page_obj.number %} active{% endif %}"><a href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ pc }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">{{ pc }}</a></li>
+ {% endif %}
+ {% endfor %}
+
+ {% if page_obj.has_next %}
+ <li><a class="next btn btn-info" href="?{% if search_query %}q={{ search_query }}&{% endif %}page={{ page_obj.next_page_number }}{% if appended_key %}&{{ appended_key }}={{ appended_value }}{% endif %}">&raquo;</a></li>
+ {% else %}
+ <li class="disabled"><span>&raquo;</span></li>
+ {% endif %}
+</ul>
+{% endif %}