{#
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.
#}
{# style #}
<style>
.ec-pager {
padding-top: 80px;
}
.ec-pager__item {
background: rgba(0, 0, 0, 0.05) !important;
border-radius: 8px;
}
.ec-pager__item--active {
border-radius: 8px;
background: var(--color-primary) !important;
color: #FFFFFF;
}
.ec-pager__item--disabled {
opacity: 0.5;
pointer-events: none;
}
.ec-pager__item--prev {
margin-right: 92px;
}
.ec-pager__item--next {
margin-left: 92px;
}
@media (max-width: 768px) {
.ec-pager__item--prev {
margin-right: 0;
}
.ec-pager__item--next {
margin-left: 0;
}
}
.ec-pager .ec-pager__item a, .ec-pager .ec-pager__item--active a {
padding: 7px 13px;
}
</style>
{% if pages.pageCount > 1 %}
<ul class="ec-pager">
{# 最初へ #}
{% if pages.firstPageInRange != 1 %}
<li class="ec-pager__item">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.first})) }}">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 0.514648L3 11.4854" stroke="#353535" stroke-width="1.35"/>
<path d="M9.90367 0.908831L6.84897 3.96353C5.72426 5.08824 5.72426 6.91176 6.84897 8.03647L9.90367 11.0912" stroke="#353535" stroke-width="1.35"/>
</svg>
</a>
</li>
{% endif %}
{# 前へ #}
{% if pages.previous is defined %}
<li class="ec-pager__item ec-pager__item--prev">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.previous})) }}">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.88804 0.993792L4.83334 4.04849C3.70863 5.1732 3.70863 6.99672 4.83334 8.12143L7.88804 11.1761" stroke="#353535" stroke-width="1.35"/>
</svg>
</a></li>
{% else %}
<li class="ec-pager__item ec-pager__item--prev ec-pager__item--disabled">
<a href="#">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.88804 0.993792L4.83334 4.04849C3.70863 5.1732 3.70863 6.99672 4.83334 8.12143L7.88804 11.1761" stroke="#353535" stroke-width="1.35"/>
</svg>
</a>
</li>
{% endif %}
{# 1ページリンクが表示されない場合、「...」を表示 #}
{% if pages.firstPageInRange != 1 %}
<li class="ec-pager__item">...</li>
{% endif %}
{% for page in pages.pagesInRange %}
{% if page == pages.current %}
<li class="ec-pager__item--active"><a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': page})) }}"> {{ page }} </a></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">...</li>
{% endif %}
{# 次へ #}
{% if pages.next is defined %}
<li class="ec-pager__item ec-pager__item--next">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.next})) }}">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.11196 0.993792L7.16666 4.04849C8.29137 5.1732 8.29137 6.99672 7.16666 8.12143L4.11196 11.1761" stroke="#353535" stroke-width="1.35"/>
</svg>
</a></li>
{% else %}
<li class="ec-pager__item ec-pager__item--next ec-pager__item--disabled">
<a href="#">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.11196 0.993792L7.16666 4.04849C8.29137 5.1732 8.29137 6.99672 7.16666 8.12143L4.11196 11.1761" stroke="#353535" stroke-width="1.35"/>
</svg>
</a>
</li>
{% endif %}
{# 最後へ #}
{% if pages.last != pages.lastPageInRange %}
<li class="ec-pager__item">
<a href="{{ path(
app.request.attributes.get('_route'),
app.request.query.all|merge({'pageno': pages.last})) }}">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 0.514648L9 11.4854" stroke="#353535" stroke-width="1.35"/>
<path d="M2.09633 0.908831L5.15103 3.96353C6.27574 5.08824 6.27574 6.91176 5.15103 8.03647L2.09633 11.0912" stroke="#353535" stroke-width="1.35"/>
</svg>
</a></li>
{% endif %}
</ul>
{% endif %}