summaryrefslogtreecommitdiff
path: root/templates/macros/pagination.jinja
blob: 04aa9cd0b47e8ed496f04cd3ba3b5d0827685c4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{% macro render_pagination(pagination) %}
  <div class=page-items>
    {{ pagination.first }} - {{ pagination.last }} of {{ pagination.total }}
  </div>
  <div class=pagination>
    {% for page in pagination.iter_pages() %}
      {% if page %}
        {% if page != pagination.page %}
          <a id="page-{{ page }}" href="/">{{ page }}</a>
        {% else %}
          <strong>{{ page }}</strong>
        {% endif %}
      {% else %}
        <span class=ellipsis>…</span>
      {% endif %}
    {% endfor %}
  </div>
{% endmacro %}

{% macro render_reply_pagination(pagination, comment_id) %}
  {% if pagination.items and pagination.has_next %}
    <button id="more-replies-{{ comment_id }}" class="reply-paginator-button">More replies</button>
  {% endif %}
{% endmacro %}