nekrochan/templates/macros/pagination.html

26 řádky
694 B
HTML

{% macro pagination(base, pages, current) %}
<div class="pagination box inline-block">
{% if current == 1 %}
[Předchozí]
{% else %}
[<a href="{{ base }}?page={{ current - 1 }}">Předchozí</a>]
{% endif %}
&#32;
{% for page in 1..(pages + 1) %}
{% if page == current %}
[<b><a href="{{ base }}?page={{ page }}">{{ page }}</a></b>]
{% else %}
[<a href="{{ base }}?page={{ page }}">{{ page }}</a>]
{% endif %}
&#32;
{% endfor %}
{% if current == pages %}
[Další]
{% else %}
[<a href="{{ base }}?page={{ current + 1 }}">Další</a>]
{% endif %}
</div>
{% endmacro %}