30 lines
995 B
HTML
30 lines
995 B
HTML
|
{%- macro render_pagination(pagination) %}
|
||
|
<div class="pagination">
|
||
|
{% if pagination.has_prev -%}
|
||
|
<a href="{{ pagination.prev|url }}">« Previous</a>
|
||
|
{% 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 -%}
|
||
|
<a href="{{ pagination.next|url }}">Next »</a>
|
||
|
{%- else -%}
|
||
|
<a class="disabled">Next »</a>
|
||
|
{%- endif %}
|
||
|
</div>
|
||
|
{% endmacro -%}
|