nekrochan/templates/macros/pagination.html

16 řádky
523 B
HTML
Surový Normální zobrazení Historie

2023-12-11 15:18:43 +00:00
{% macro pagination(base, pages, current) %}
<div class="box inline-block pagination">
{% if pages == 0 %}
<b><a href="{{ base }}?page=1">[1]</a></b>&#32;
{% else %}
{% for page in 1..(pages + 1) %}
{% if page == current %}
<b><a href="{{ base }}?page={{ page }}">[{{ page }}]</a></b>&#32;
{% else %}
<a href="{{ base }}?page={{ page }}">[{{ page }}]</a>&#32;
{% endif %}
{% endfor %}
{% endif %}
</div>
{% endmacro %}