aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/includes/pagination.html
blob: 6e7ec6089997c5dc4e14904790e4a63f5c4acc1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 %}