This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/_sakura/templates/yuuno/elements/pagination.tpl
flashwave bc36d74bba r20151116
Signed-off-by: Flashwave <me@flash.moe>
2015-11-16 23:05:45 +01:00

20 lines
1.3 KiB
Smarty
Executable file

{% set paginationSeparator %}{% if '?' in pagination.page %}&amp;{% else %}?{% endif %}{% endset %}
{% set paginationPage = get.page|default(1) %}
<div class="pagination{% if paginationClass %} {{ paginationClass }}{% endif %}">
{% if paginationPages|length > 1 %}
{% if paginationPage > 1 %}
<a href="{{ paginationUrl }}{{ paginationSeparator }}page=1"><span class="fa fa-fast-backward"></span></a>
<a href="{{ paginationUrl }}{{ paginationSeparator }}page={{ paginationPage - 1 }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,page in paginationPages %}
{% if (id + 1) > (paginationPage - 3) and (id + 1) < (paginationPage + 3) %}
<a href="{{ paginationUrl }}{{ paginationSeparator }}page={{ id + 1 }}"{% if id == paginationPage - 1 %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endif %}
{% endfor %}
{% if paginationPage < paginationPages|length %}
<a href="{{ paginationUrl }}{{ paginationSeparator }}page={{ paginationPage + 1 }}"><span class="fa fa-step-forward"></span></a>
<a href="{{ paginationUrl }}{{ paginationSeparator }}page={{ paginationPages|length }}"><span class="fa fa-fast-forward"></span></a>
{% endif %}
{% endif %}
</div>