aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/includes/pagination.html
blob: 35dac5381cbe6ad3c429492107aa8ff515b6d60b (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
25
26
27
{% 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 %}