vendor/knplabs/knp-paginator-bundle/templates/Pagination/sliding.html.twig line 1

  1. {#
  2. /**
  3.  * @file
  4.  * Twitter Bootstrap v4 Sliding pagination control implementation.
  5.  *
  6.  * View that can be used with the pagination module
  7.  * from the Twitter Bootstrap CSS Toolkit
  8.  * https://getbootstrap.com/docs/4.5/components/pagination/
  9.  *
  10.  */
  11. #}
  12. {% if pageCount > 1 %}
  13.     <nav>
  14.         {% set classAlign = (align is not defined) ? '' : align=='center' ? ' justify-content-center' : (align=='right' ? ' justify-content-end' : '') %}
  15.         {% set classSize = (size is not defined) ? '' : size=='large' ? ' pagination-lg' : (size=='small' ? ' pagination-sm' : '') %}
  16.         <ul class="pagination{{ classAlign }}{{ classSize }}">
  17.             {% if previous is defined %}
  18.                 <li class="page-item">
  19. {#                    <a class="page-link" rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">&laquo;&nbsp;{{ 'label_previous'|trans({}, 'KnpPaginatorBundle') }}</a>#}
  20.                     <a class="page-link" rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">&laquo;&nbsp;</a>
  21.                 </li>
  22.             {% else %}
  23.                 <li class="page-item disabled">
  24. {#                    <span class="page-link">&laquo;&nbsp;{{ 'label_previous'|trans({}, 'KnpPaginatorBundle') }}</span>#}
  25. {#                    <span class="page-link">&laquo;&nbsp;</span>#}
  26.                 </li>
  27.             {% endif %}
  28.             {% if startPage > 1 %}
  29.                 <li class="page-item">
  30.                     <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
  31.                 </li>
  32.                 {% if startPage == 3 %}
  33.                     <li class="page-item">
  34.                         <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
  35.                     </li>
  36.                 {% elseif startPage != 2 %}
  37.                     <li class="page-item disabled">
  38.                         <span class="page-link">&hellip;</span>
  39.                     </li>
  40.                 {% endif %}
  41.             {% endif %}
  42.             {% for page in pagesInRange %}
  43.                 {% if page != current %}
  44.                     <li class="page-item">
  45.                         <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
  46.                     </li>
  47.                 {% else %}
  48.                     <li class="page-item active">
  49.                         <span class="page-link">{{ page }}</span>
  50.                     </li>
  51.                 {% endif %}
  52.             {% endfor %}
  53.             {% if pageCount > endPage %}
  54.                 {% if pageCount > (endPage + 1) %}
  55.                     {% if pageCount > (endPage + 2) %}
  56.                         <li class="page-item disabled">
  57.                             <span class="page-link">&hellip;</span>
  58.                         </li>
  59.                     {% else %}
  60.                         <li class="page-item">
  61.                             <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
  62.                         </li>
  63.                     {% endif %}
  64.                 {% endif %}
  65.                 <li class="page-item">
  66.                     <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
  67.                 </li>
  68.             {% endif %}
  69.             {% if next is defined %}
  70.                 <li class="page-item">
  71. {#                    <a class="page-link" rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">{{ 'label_next'|trans({}, 'KnpPaginatorBundle') }}&nbsp;&raquo;</a>#}
  72.                     <a class="page-link" rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">&nbsp;&raquo;</a>
  73.                 </li>
  74.             {% else %}
  75.                 <li  class="page-item disabled">
  76. {#                    <span class="page-link">&nbsp;&raquo;</span>#}
  77. {#                    <span class="page-link">{{ 'label_next'|trans({}, 'KnpPaginatorBundle') }}&nbsp;&raquo;</span>#}
  78.                 </li>
  79.             {% endif %}
  80.         </ul>
  81.     </nav>
  82. {% endif %}