{#
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="mx-auto mt-20 flex w-[46rem] justify-center gap-6 md:gap-3 px-6 md:w-full text-sm leading-normal">
{# 最初へ #}
{% if pages.firstPageInRange != 1 %}
<a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.first})) }}" class="grid size-9 place-items-center rounded-full border">1</a>
{% endif %}
{# 1ページリンクが表示されない場合、「...」を表示 #}
{% if pages.firstPageInRange != 1 %}
<p class="grid place-items-center">...</p>
{% endif %}
{% for page in pages.pagesInRange %}
{% if page == pages.current %}
<a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': page})) }}" class="grid size-9 place-items-center rounded-full border bg-black text-white">
{{ page }}
</a>
{% else %}
<a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': page})) }}" class="grid size-9 place-items-center rounded-full border">
{{ page }}
</a>
{% endif %}
{% endfor %}
{# 最終ページリンクが表示されない場合、「...」を表示 #}
{% if pages.last != pages.lastPageInRange %}
<p class="grid place-items-center">...</p>
{% endif %}
{# 最後へ #}
{% if pages.last != pages.lastPageInRange %}
<a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.last})) }}" class="grid size-9 place-items-center rounded-full border">
{{ pages.last }}</a>
{% endif %}
</div>
{% endif %}