2022-01-17 01:05:24 +01:00
|
|
|
{%- macro render_pagination(pagination) %}
|
2022-01-09 17:33:15 +01:00
|
|
|
<div class="pagination">
|
2022-01-17 01:05:24 +01:00
|
|
|
{% if pagination.has_prev -%}
|
2022-01-09 17:33:15 +01:00
|
|
|
<a href="{{ pagination.prev|url }}">« Previous</a>
|
2022-01-17 01:05:24 +01:00
|
|
|
{% else -%}
|
|
|
|
<a class="disabled">« Previous</a>
|
|
|
|
{% endif -%}
|
|
|
|
{% for site in range(pagination.pages) -%}
|
|
|
|
{% if site == 0 -%}
|
|
|
|
{%- if pagination.page == site + 1 -%}
|
|
|
|
<a class="disabled">{{ pagination.page }}</a>
|
|
|
|
{%- else -%}
|
|
|
|
<a href="{{ './'| url }}">{{ site + 1 }}</a>
|
|
|
|
{%- endif -%}
|
|
|
|
{%- else -%}
|
|
|
|
{%- if pagination.page == site + 1 -%}
|
|
|
|
<a class="disabled" >{{ pagination.page }}</a>
|
|
|
|
{%- else -%}
|
|
|
|
<a href="{{ './'| url }}page/{{ site + 1 }}/">{{ site + 1 }}</a>
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endif %}
|
|
|
|
{% endfor -%}
|
|
|
|
{% if pagination.has_next -%}
|
2022-01-09 17:33:15 +01:00
|
|
|
<a href="{{ pagination.next|url }}">Next »</a>
|
2022-01-17 01:05:24 +01:00
|
|
|
{%- else -%}
|
|
|
|
<a class="disabled">Next »</a>
|
|
|
|
{%- endif %}
|
2022-01-09 17:33:15 +01:00
|
|
|
</div>
|
2022-01-17 01:05:24 +01:00
|
|
|
{% endmacro -%}
|