templates/Global/pagination.html.twig line 1

Open in your IDE?
  1. {% if pageCount > 1 %}
  2.     <nav class="pt-3">
  3.         {% set classAlign = (align is not defined) ? '' : align=='center' ? ' justify-content-center' : (align=='right' ? ' justify-content-end' : '') %}
  4.         {% set classSize = (size is not defined) ? '' : size=='large' ? ' pagination-lg' : (size=='small' ? ' pagination-sm' : '') %}
  5.         <ul class="pagination{{ classAlign }}{{ classSize }}">
  6.             {% if previous is defined %}
  7.                 <li class="page-item">
  8.                     <a class="page-link" rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">
  9.                         {% if app.request.locale == 'ar' %}
  10.                             <i class="fas fa-angle-right"></i>
  11.                         {% else %}
  12.                             <i class="fas fa-angle-left"></i>
  13.                         {% endif %}
  14.                     </a>
  15.                 </li>
  16.             {% else %}
  17.                 <li class="page-item disabled">
  18.                     <span class="page-link">
  19.                         {% if app.request.locale == 'ar' %}
  20.                             <i class="fas fa-angle-right"></i>
  21.                         {% else %}
  22.                             <i class="fas fa-angle-left"></i>
  23.                         {% endif %}
  24.                     </span>
  25.                 </li>
  26.             {% endif %}
  27.             {% if startPage > 1 %}
  28.                 <li class="page-item">
  29.                     <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
  30.                 </li>
  31.                 {% if startPage == 3 %}
  32.                     <li class="page-item">
  33.                         <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
  34.                     </li>
  35.                 {% elseif startPage != 2 %}
  36.                     <li class="page-item disabled">
  37.                         <span class="page-link">&hellip;</span>
  38.                     </li>
  39.                 {% endif %}
  40.             {% endif %}
  41.             {% for page in pagesInRange %}
  42.                 {% if page != current %}
  43.                     <li class="page-item">
  44.                         <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
  45.                     </li>
  46.                 {% else %}
  47.                     <li class="page-item active">
  48.                         <span class="page-link">{{ page }}</span>
  49.                     </li>
  50.                 {% endif %}
  51.             {% endfor %}
  52.             {% if pageCount > endPage %}
  53.                 {% if pageCount > (endPage + 1) %}
  54.                     {% if pageCount > (endPage + 2) %}
  55.                         <li class="page-item disabled">
  56.                             <span class="page-link">&hellip;</span>
  57.                         </li>
  58.                     {% else %}
  59.                         <li class="page-item">
  60.                             <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
  61.                         </li>
  62.                     {% endif %}
  63.                 {% endif %}
  64.                 <li class="page-item">
  65.                     <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
  66.                 </li>
  67.             {% endif %}
  68.             {% if next is defined %}
  69.                 <li class="page-item">
  70.                     <a class="page-link" rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">
  71.                         {% if app.request.locale == 'ar' %}
  72.                             <i class="fas fa-angle-left"></i>
  73.                         {% else %}
  74.                             <i class="fas fa-angle-right"></i>
  75.                         {% endif %}
  76.                     </a>
  77.                 </li>
  78.             {% else %}
  79.                 <li  class="page-item disabled">
  80.                     <span class="page-link">
  81.                         {% if app.request.locale == 'ar' %}
  82.                             <i class="fas fa-angle-left"></i>
  83.                         {% else %}
  84.                             <i class="fas fa-angle-right"></i>
  85.                         {% endif %}
  86.                     </span>
  87.                 </li>
  88.             {% endif %}
  89.         </ul>
  90.     </nav>
  91. {% endif %}