{% trans_default_domain 'EasyAdminBundle' %} {% set _paginator_request_parameters = _request_parameters|merge({'referer': null}) %}
{# --({{ paginator.currentPage }}/{{ paginator.nbPages }})-- #}
{{ 'paginator.results'|transchoice(paginator.nbResults)|raw }} {# BEGIN DISPLAYING PAGE NUMBERS #} {# the number of pages that are displayed around the active page #} {% set nearbyPagesLimit = 15 %} {% if paginator.nbPages <= nearbyPagesLimit %} {% set bottom_limit = paginator.currentPage-nearbyPagesLimit %} {% set top_limit = paginator.currentPage + nearbyPagesLimit %} {% else %} {% if paginator.currentPage <5 %} {% set top_limit = paginator.currentPage + 9 %} {% set bottom_limit = paginator.currentPage-9 %} {% else %} {% set top_limit = paginator.currentPage + 5 %} {% set bottom_limit = paginator.currentPage-5 %} {% endif %} {% endif %} {% if paginator.currentPage > 1 %} {% for i in range(bottom_limit, paginator.currentPage-1) %} {% if ( i > 0 ) %} {{ i }} {% endif %} {% endfor %} {% endif %} {{ paginator.currentPage }} {% set last_page = paginator.nbPages %} {% if paginator.currentPage < paginator.nbPages %} {% for i in range(paginator.currentPage+1, top_limit ) %} {% if ( i <= paginator.nbPages ) %} {% set last_page = i %} {{ i }} {% endif %} {% endfor %} {% endif %} {% if last_page != paginator.nbPages %} .... {{ paginator.nbPages }} {% endif %}