contentdb/app/templates/macros/pagination.html

30 lines
1000 B
HTML
Raw Permalink Normal View History

{% macro render_pagination(pagination, url_set_query) %}
<ul class="pagination mt-4">
{% 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 %}
<li class="page-item {% if not prev_url %}disabled{% endif %}">
<a class="page-link" {% if prev_url %}href="{{ prev_url }}"{% endif %}>&laquo;</a>
</li>
{%- for page in pagination.iter_pages() %}
{% if page %}
<li class="page-item {% if page == pagination.page %}active{% endif %}">
<a class="page-link"
href="{{ url_set_query(page=page) }}">
{{ 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>
</li>
{% endif %}
{%- endfor %}
<li class="page-item {% if not next_url %}disabled{% endif %}">
<a class="page-link" {% if next_url %}href="{{ next_url }}"{% endif %}>&raquo;</a>
</li>
2020-07-12 18:52:30 +02:00
</ul>
{% endmacro %}