2020-07-12 18:15:30 +02:00
|
|
|
{% macro render_pagination(pagination, url_set_query) %}
|
2020-07-10 23:08:52 +02:00
|
|
|
<ul class="pagination mt-4">
|
2020-07-12 18:15:30 +02:00
|
|
|
{% set prev_url = url_set_query(page=pagination.prev_num) if pagination.has_prev %}
|
|
|
|
{% set next_url = url_set_query(page=pagination.next_num) if pagination.has_next %}
|
2020-07-10 23:08:52 +02:00
|
|
|
|
|
|
|
<li class="page-item {% if not prev_url %}disabled{% endif %}">
|
|
|
|
<a class="page-link" {% if prev_url %}href="{{ prev_url }}"{% endif %}>«</a>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
{%- for page in pagination.iter_pages() %}
|
|
|
|
{% if page %}
|
|
|
|
<li class="page-item {% if page == pagination.page %}active{% endif %}">
|
|
|
|
<a class="page-link"
|
2020-07-12 18:15:30 +02:00
|
|
|
href="{{ url_set_query(page=page) }}">
|
2020-07-10 23:08:52 +02:00
|
|
|
{{ page }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% else %}
|
|
|
|
<li class="page-item disabled">
|
2020-07-10 23:11:34 +02:00
|
|
|
<a class="page-link" href="#" tabindex="-1">…</a>
|
2020-07-10 23:08:52 +02:00
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
<li class="page-item {% if not next_url %}disabled{% endif %}">
|
|
|
|
<a class="page-link" {% if next_url %}href="{{ next_url }}"{% endif %}>»</a>
|
|
|
|
</li>
|
2020-07-12 18:52:30 +02:00
|
|
|
</ul>
|
2020-07-10 23:08:52 +02:00
|
|
|
{% endmacro %}
|