{#
/**
* @file
* Twitter Bootstrap v4 Sliding pagination control implementation.
*
* View that can be used with the pagination module
* from the Twitter Bootstrap v4 CSS Toolkit
* https://v4-alpha.getbootstrap.com/components/pagination/
*
* @author Carlos Delgado <dev@ourcodeworld.com>
*/
#}
{% if pageCount > 1 %}
<ul class="pagination">
{% if previous is defined %}
<li class="page-item">
<a rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}" class="page-link">« Précédent</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link">« Précédent</span>
</li>
{% endif %}
{% if startPage > 1 %}
<li class="page-item">
<a href="{{ path(route, query|merge({(pageParameterName): 1})) }}" class="page-link">1</a>
</li>
{% if startPage == 3 %}
<li class="page-item">
<a href="{{ path(route, query|merge({(pageParameterName): 2})) }}" class="page-link">2</a>
</li>
{% elseif startPage != 2 %}
<li class="page-item disabled">
<span class="page-link">…</span>
</li>
{% endif %}
{% endif %}
{% for page in pagesInRange %}
{% if page != current %}
<li class="page-item">
<a href="{{ path(route, query|merge({(pageParameterName): page})) }}" class="page-link">{{ page }}</a>
</li>
{% else %}
<li class="active page-item">
<span class="page-link">{{ page }}</span>
</li>
{% endif %}
{% endfor %}
{% if pageCount > endPage %}
{% if pageCount > (endPage + 1) %}
{% if pageCount > (endPage + 2) %}
<li class="page-item disabled">
<span class="page-link">…</span>
</li>
{% else %}
<li class="page-item">
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}" class="page-link">{{ pageCount -1 }}</a>
</li>
{% endif %}
{% endif %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}" class="page-link">{{ pageCount }}</a>
</li>
{% endif %}
{% if next is defined %}
<li class="page-item">
<a rel="next" class="page-link" href="{{ path(route, query|merge({(pageParameterName): next})) }}">Suivant »</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link">Suivant »</span>
</li>
{% endif %}
</ul>
{% endif %}