{#
/**
* @file
* Foundation 5 Sliding pagination control implementation.
*
* View that can be used with the pagination module
* from the Foundation 5 CSS Toolkit
* http://foundation.zurb.com/docs/components/pagination.html
*
* @author Vincent Loy <vincent.loy1@gmail.com>
*
* This view have been ported from twitter bootstrap v3 pagination control implementation
* from :
* @author Pablo Díez <pablodip@gmail.com>
* @author Jan Sorgalla <jsorgalla@gmail.com>
* @author Artem Ponomarenko <imenem@inbox.ru>
* @author Artem Zabelin <artjomzabelin@gmail.com>
*/
#}
{% if pageCount > 1 %}
<div class="grid-x">
<nav class="flex-container pagination t-label-regular medium-shrink cell">
<a rel="prev" href="{{ previous is defined ? path(route, query|merge({(pageParameterName): previous})) : '#' }}"
aria-label='{{ 'label_previous'|trans({}, 'KnpPaginatorBundle') }}'
{% if previous is not defined %}disabled{% endif %}>
<svg width="6" height="10">
<use xlink:href='#chevron-small'>
</svg>
</a>
<ul class="show-for-medium">
{% if startPage > 1 %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
</li>
{% if startPage == 3 %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
</li>
{% elseif false and startPage != 2 %}
<li class="unavailable">
<a>…</a>
</li>
{% endif %}
{% endif %}
{% for page in pagesInRange %}
{% if page != current %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): page})) }}">
{{ page }}
</a>
</li>
{% else %}
<li class="current">
<a class="active">{{ page }}</a>
</li>
{% endif %}
{% endfor %}
{% if pageCount > endPage %}
{% if pageCount > (endPage + 1) %}
{% if pageCount <= (endPage + 2) %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">
{{ pageCount -1 }}
</a>
</li>
{% elseif false %}
<li class="unavailable">
<a>…</a>
</li>
{% endif %}
{% endif %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
</li>
{% endif %}
</ul>
<a rel="next" href="{{ next is defined ? path(route, query|merge({(pageParameterName): next })) : '#' }}"
aria-label="{{ 'label_next'|trans({}, 'KnpPaginatorBundle') }}" class="scale-x--1"
{% if next is not defined %}disabled{% endif %}>
<svg width="6" height="10">
<use xlink:href='#chevron-small'>
</svg>
</a>
</nav>
{% if next is defined %}
{% set voirplus = app.request.locale == 'fr' ? 'Voir plus' : 'View more' %}
<div class="pagination pagination--child-links-width-100 auto cell voir-plus">
<a rel="next" href="{{path( route, query|merge({ (pageParameterName): next }) ) }}" data-load-more>
{{voirplus}}
</a>
</div>
{% endif %}
</div>
{% endif %}