<!-- MonsieurBizSyliusPlugin/Common/_pagination -->

{% set paginationLimits = (limits) %}
{% set currentLimit = paginationLimits|first %}
{% if app.request.query.all is not empty and app.request.query.all.limit is defined %}
    {% set currentLimit = app.request.query.all.limit %}
{% endif %}

<div class="listing-show">
    <label>{{ 'sylius.ui.show'|trans }} :</label>
    <ul>
        {% for limit in paginationLimits %}
            {% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge(app.request.query.all)|merge({'limit': limit})) %}
            <li {% if currentLimit == limit %}class="active"{% endif %}><a href="{{ path }}">{{ limit }}</a></li>
        {% endfor %}
    </ul>
</div>
