grav/themes/materialize/templates/partials/pagination.html.twig

29 lines
1.1 KiB
Twig

{% if pagination|length > 1 %}
<ul class="pagination">
{% if pagination.hasPrev %}
{% set url = (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
<li class="waves-effect"><a href="{{ url }}"><i class="mdi mdi-chevron-left"></i></a></li>
{% else %}
<li class="disabled"><i class="mdi mdi-chevron-left"></i></li>
{% endif %}
{% for paginate in pagination %}
{% if paginate.isCurrent %}
<li class="active">{{ paginate.number }}</li>
{% elseif paginate.isInDelta %}
{% set url = (base_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %}
<li class="waves-effect"><a href="{{ url }}">{{ paginate.number }}</a></li>
{% elseif paginate.isDeltaBorder %}
<li><span>&hellip;</span></li>
{% endif %}
{% endfor %}
{% if pagination.hasNext %}
{% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}
<li class="waves-effect"><a href="{{ url }}"><i class="mdi mdi-chevron-right"></i></a></li>
{% else %}
<li class="disabled"><i class="mdi mdi-chevron-right"></i></li>
{% endif %}
</ul>
{% endif %}