{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% if pages.pageCount > 1 %}
<ul class="pagination col-auto">
<!-- 最初へ -->
{% if pages.firstPageInRange != 1 %}
<li class="page-item">
{# FIXME: Need check pass routes before use default _route from request #}
{% set request = app.request.query.all|merge({'page_no': pages.first}) %}
{% set request = id is defined ? request|merge({'id': id}) : request %}
<a class="page-link"
href="{{ path(routes ? routes : app.request.attributes.get('_route'), request) }}">{{ 'admin.common.first'|trans }}</a></li>
{% endif %}
<!-- 前へ -->
{% if pages.previous is defined %}
<li class="page-item">
{# FIXME: Need check pass routes before use default _route from request #}
{% set request = app.request.query.all|merge({'page_no': pages.previous}) %}
{% set request = id is defined ? request|merge({'id': id}) : request %}
<a class="page-link"
href="{{ path(routes ? routes : app.request.attributes.get('_route'), request) }}">{{ 'admin.common.prev'|trans }}</a>
</li>
{% endif %}
<!-- 1ページリンクが表示されない場合、「...」を表示 -->
{% if pages.firstPageInRange != 1 %}
<li class="page-item">...</li>
{% endif %}
{% for page in pages.pagesInRange %}
<li class="page-item{% if page == pages.current %} active{% endif %}">
{# FIXME: Need check pass routes before use default _route from request #}
{% set request = app.request.query.all|merge({'page_no': page}) %}
{% set request = id is defined ? request|merge({'id': id}) : request %}
<a class="page-link"
href="{{ path(routes ? routes : app.request.attributes.get('_route'), request) }}">
{{ page }}
</a>
</li>
{% endfor %}
<!-- 最終ページリンクが表示されない場合、「...」を表示 -->
{% if pages.last != pages.lastPageInRange %}
<li class="page-item">...</li>
{% endif %}
<!-- 次へ -->
{% if pages.next is defined %}
<li class="page-item">
{# FIXME: Need check pass routes before use default _route from request #}
{% set request = app.request.query.all|merge({'page_no': pages.next}) %}
{% set request = id is defined ? request|merge({'id': id}) : request %}
<a class="page-link"
href="{{ path(routes ? routes : app.request.attributes.get('_route'), request) }}">{{ 'admin.common.next'|trans }}</a>
</li>
{% endif %}
<!-- 最後へ -->
{% if pages.last != pages.lastPageInRange %}
<li class="page-item">
{# FIXME: Need check pass routes before use default _route from request #}
{% set request = app.request.query.all|merge({'page_no': pages.last}) %}
{% set request = id is defined ? request|merge({'id': id}) : request %}
<a class="page-link"
href="{{ path(routes ? routes : app.request.attributes.get('_route'), request) }}">{{ 'admin.common.last'|trans }}</a></li>
{% endif %}
</ul>
{% endif %}