{#
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-full justify-between items-center gap-6 md:gap-3 md:w-full text-sm leading-normal">
{# 前のページへ #}
{% if pages.current > 1 %}
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'route': app.request.attributes.get('route'), 'pageno': pages.current - 1})) }}" class="size-9">
<img src="{{ asset('assets/img/info/Link.svg') }}" alt="Previous" style="transform: scaleX(-1);">
</a>
{% else %}
<span class="size-9"></span>
{% endif %}
<div class="flex justify-center gap-2 md:gap-1">
{# 最初へ #}
{% if pages.firstPageInRange != 1 %}
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'route': app.request.attributes.get('route'), 'pageno': pages.first})) }}">1</a>
<span>|</span>
{% endif %}
{# 1ページリンクが表示されない場合、「...」を表示 #}
{% if pages.firstPageInRange != 1 %}
<p>...</p>
<span>|</span>
{% endif %}
{# ページ番号リンクを表示 #}
{% for page in pages.pagesInRange %}
{% if page == pages.current %}
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'route': app.request.attributes.get('route'), 'pageno': page})) }}" class="underline">
{{ page }}
</a>
{% else %}
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'route': app.request.attributes.get('route'), 'pageno': page})) }}">
{{ page }}
</a>
{% endif %}
{% if not loop.last %}
<span>|</span>
{% endif %}
{% endfor %}
{# 最終ページリンクが表示されない場合、「...」を表示 #}
{% if pages.last != pages.lastPageInRange %}
<span>|</span>
<p>...</p>
<span>|</span>
{% endif %}
{# 最後へ #}
{% if pages.last != pages.lastPageInRange %}
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'route': app.request.attributes.get('route'), 'pageno': pages.last})) }}">
{{ pages.last }}
</a>
{% endif %}
</div>
{# 次のページへ #}
{% if pages.current < pages.pageCount %}
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'route': app.request.attributes.get('route'), 'pageno': pages.current + 1})) }}" class="size-9">
<img src="{{ asset('assets/img/info/Link.svg') }}" alt="Next">
</a>
{% else %}
<span class="size-9"></span>
{% endif %}
</div>
{% endif %}