{#
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 %}
<div class="pager_wrap">
{# 前へ #}
<div class="pager_arrow left">
{% if pages.previous is defined %}
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.previous})) }}"><i class="fas fa-chevron-circle-left"></i></a>
{% endif %}
</div>
<ul class="ec-pager">
{# 最初へ #}
{% if pages.firstPageInRange != 1 %}
<li class="ec-pager__item pager_first">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.first})) }}">{{ pages.first }}</a></li>
{% endif %}
{# 1ページリンクが表示されない場合、「...」を表示 #}
{% if pages.firstPageInRange != 1 %}
<li class="ec-pager__item pager_dot">...</li>
{% endif %}
{% for page in pages.pagesInRange %}
{% if page == pages.current %}
<li class="ec-pager__item--active">{{ page }}</li>
{% else %}
<li class="ec-pager__item"><a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': page})) }}">{{ page }}</a></li>
{% endif %}
{% endfor %}
{# 最終ページリンクが表示されない場合、「...」を表示 #}
{% if pages.last != pages.lastPageInRange %}
<li class="ec-pager__item pager_dot">...</li>
{% endif %}
{# 最後へ #}
{% if pages.last != pages.lastPageInRange %}
<li class="ec-pager__item pager_last">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.last})) }}">{{ pages.last }}</a></li>
{% endif %}
</ul>
{# 次へ #}
<div class="pager_arrow right">
{% if pages.next is defined %}
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.next})) }}"><i class="fas fa-chevron-circle-right"></i></a>
{% endif %}
</div>
</div>
{% endif %}