{% trans_default_domain 'EasyAdminBundle' %}
{% set _paginator_request_parameters = _request_parameters|merge({'referer': null}) %}
<div class="list-pagination">
<div class="list-pagination-counter">
{{ 'paginator.results'|transchoice(paginator.nbResults)|raw }}
</div>
<nav class="pager list-pagination-paginator {{ not paginator.hasPreviousPage ? 'first-page' }} {{ not paginator.hasNextPage ? 'last-page' }}">
<ul class="pagination">
<li class="page-item {{ not paginator.hasPreviousPage ? 'disabled' }}">
<a class="page-link" href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: 1 }) ) }}">
<i class="fa fa-angle-left mx-1"></i> <span class="btn-label">{{ 'paginator.first'|trans }}</span>
</a>
</li>
<li class="page-item {{ not paginator.hasPreviousPage ? 'disabled' }}">
<a class="page-link" href="{{ not paginator.hasPreviousPage ? '#' : path('easyadmin', _paginator_request_parameters|merge({ page: paginator.previousPage }) ) }}">
<i class="fa fa-angle-left mx-1"></i> <span class="btn-label">{{ 'paginator.previous'|trans }}</span>
</a>
</li>
{# BEGIN DISPLAYING PAGE NUMBERS #}
{# the number of pages that are displayed around the active page #}
{% set nearbyPagesLimit = 4 %}
{% if paginator.currentPage > 1 %}
{% for i in range(paginator.currentPage-nearbyPagesLimit, paginator.currentPage-1) %}
{% if i > 0 %}
<li class="page-item">
<a class="page-link" href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: i }) ) }}">{{ i }}</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
<li class="page-item">
<a class="page-link current">{{ paginator.currentPage }}</a>
</li>
{% if paginator.currentPage < paginator.nbPages %}
{% for i in range(paginator.currentPage+1, paginator.currentPage + nearbyPagesLimit) %}
{% if i <= paginator.nbPages %}
<li class="page-item">
<a class="page-link" href="{{ path('easyadmin', _paginator_request_parameters|merge({ page: i }) ) }}">{{ i }}</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{# END DISPLAYING PAGE NUMBERS #}
<li class="page-item {{ not paginator.hasNextPage ? 'disabled' }}">
<a class="page-link" href="{{ not paginator.hasNextPage ? '#' : path('easyadmin', _paginator_request_parameters|merge({ page: paginator.nextPage }) ) }}">
<span class="btn-label">{{ 'paginator.next'|trans }}</span> <i class="fa fa-angle-right mx-1"></i>
</a>
</li>
<li class="page-item {{ not paginator.hasNextPage ? 'disabled' }}">
<a class="page-link" href="{{ not paginator.hasNextPage ? '#' : path('easyadmin', _paginator_request_parameters|merge({ page: paginator.nbPages }) ) }}">
<span class="btn-label">{{ 'paginator.last'|trans }}</span> <i class="fa fa-angle-right mx-1"></i>
</a>
</li>
</ul>
</nav>
</div>