{#
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 justify-content-center mt-5">
{# 最初へ #}
{% if pages.firstPageInRange != 1 %}
<!--
<li class="page-item">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.first})) }}" class="page-link text-dark">{{ '最初へ'|trans }}</a></li>
-->
{% endif %}
{# 前へ #}
{% if pages.previous is defined %}
{% if pages.previous != 1 %}
<li class="page-item">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.previous})) }}" class="page-link text-dark">{{ '前へ'|trans }}</a></li>
{% else %}
<li class="page-item">
<a href="{{ path(
app.request.attributes.get('_route')) }}" class="page-link text-dark">{{ '前へ'|trans }}</a></li>
{% endif %}
{% endif %}
{# 1ページリンクが表示されない場合、「...」を表示 #}
{% if pages.firstPageInRange != 1 %}
<li class="page-item">...</li>
{% endif %}
{% for page in pages.pagesInRange %}
{% if page == pages.current %}
<li class="page-item"><a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': page})) }}" class="page-link text-dark active"> {{ page }} </a></li>
{% else %}
<li class="page-item"><a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': page})) }}" class="page-link text-dark"> {{ page }} </a></li>
{% endif %}
{% endfor %}
{# 最終ページリンクが表示されない場合、「...」を表示 #}
{% if pages.last != pages.lastPageInRange %}
<li class="page-item">...</li>
{% endif %}
{# 次へ #}
{% if pages.next is defined %}
<li class="page-item">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.next})) }}" class="page-link text-dark">{{ '次へ'|trans }}</a></li>
{% endif %}
{# 最後へ #}
{% if pages.last != pages.lastPageInRange %}
<!--
<li class="page-item">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.last})) }}" class="page-link text-dark">{{ '最後へ'|trans }}</a></li>
-->
{% endif %}
</ul>
{% endif %}