templates/bundles/knp-paginator-bundle/Pagination/custom_pagination_two_cols.html.twig line 1

Open in your IDE?
  1. <div class="col-12">
  2.     <div class="row no-gutters align-items-center justify-content-between">
  3.         {% if (show_legend is defined and show_legend) or show_legend is not defined %}
  4.             <div class="col-12 col-sm text-center text-sm-start">
  5.                 <p class="mb-0 font-size-16 align-self-center">{{ 'pagina_total' | trans({'{current}' : current, '{pageCount}': pageCount, '{totalCount}' : totalCount }) }}</p>
  6.             </div>
  7.         {% endif %}
  8.         {% if pageCount > 1 %}
  9.             <div class="col-xs-12 col-sm-auto text-center text-sm-start d-inline-flex">
  10.                 <nav class="m-auto mr-sm-0">
  11.                     {% set classAlign = (align is not defined) ? '' : align=='center' ? ' justify-content-center' : (align=='right' ? ' justify-content-end' : '') %}
  12.                     {% set classSize = (size is not defined) ? '' : size=='large' ? ' pagination-lg' : (size=='small' ? ' pagination-sm' : '') %}
  13.                     <ul class="pagination pagination-outline {{ classAlign }}{{ classSize }} mb-0 rounded me-2">
  14.                         {% if previous is defined %}
  15.                             <li class="page-item">
  16.                                 <a class="page-link" rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">&laquo;&nbsp;{{ 'label_previous'|trans({}, 'messages') }}</a>
  17.                             </li>
  18.                         {% else %}
  19.                             <li class="page-item disabled">
  20.                                 <span class="page-link">&laquo;&nbsp;{{ 'label_previous'|trans({}, 'messages') }}</span>
  21.                             </li>
  22.                         {% endif %}
  23.                         {% if startPage > 1 %}
  24.                             <li class="page-item">
  25.                                 <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
  26.                             </li>
  27.                             {% if startPage == 3 %}
  28.                                 <li class="page-item">
  29.                                     <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
  30.                                 </li>
  31.                             {% elseif startPage != 2 %}
  32.                                 <li class="page-item disabled">
  33.                                     <span class="page-link">&hellip;</span>
  34.                                 </li>
  35.                             {% endif %}
  36.                         {% endif %}
  37.                         {% for page in pagesInRange %}
  38.                             {% if page != current %}
  39.                                 <li class="page-item">
  40.                                     <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
  41.                                 </li>
  42.                             {% else %}
  43.                                 <li class="page-item active">
  44.                                     <span class="page-link">{{ page }}</span>
  45.                                 </li>
  46.                             {% endif %}
  47.                         {% endfor %}
  48.                         {% if pageCount > endPage %}
  49.                             {% if pageCount > (endPage + 1) %}
  50.                                 {% if pageCount > (endPage + 2) %}
  51.                                     <li class="page-item disabled">
  52.                                         <span class="page-link">&hellip;</span>
  53.                                     </li>
  54.                                 {% else %}
  55.                                     <li class="page-item">
  56.                                         <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
  57.                                     </li>
  58.                                 {% endif %}
  59.                             {% endif %}
  60.                             <li class="page-item">
  61.                                 <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
  62.                             </li>
  63.                         {% endif %}
  64.                         {% if next is defined %}
  65.                             <li class="page-item border-left">
  66.                                 <a class="page-link" rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">{{ 'label_next'|trans({}, 'messages') }}&nbsp;&raquo;</a>
  67.                             </li>
  68.                         {% else %}
  69.                             <li  class="page-item disabled">
  70.                                 <span class="page-link">{{ 'label_next'|trans({}, 'messages') }}&nbsp;&raquo;</span>
  71.                             </li>
  72.                         {% endif %}
  73.                     </ul>
  74.                 </nav>
  75.             </div>
  76.         {% endif %}
  77.         {% if ((show_limit is defined and show_limit) or show_limit is not defined) and totalCount > 0 %}
  78.             <div class="col-12 col-sm-auto rounded sel_paginator_limit">
  79.                 {% if p_selUnidades is not defined %}
  80.                     {% set p_selUnidades = { '6': '6', '12': '12', '50':'50', '100':'100', '999999999': 'Todos'} %}
  81.                 {% endif %}
  82.                 {% if p_selUnidades|length > 0 %}
  83.                     {#<p class="text-sm-end text-center">Items por página:</p>#}
  84.                     <select name="l" class="form-select form-select-solid {{ limit_class | default('sel_unidades_paginator') }}" {{ p_autoreload | default(false) ? 'data-reload="true"' }} data-route="{{ route }}" data-params="{{ (query|merge({(pageParameterName): 1})) | json_encode() }}">
  85.                         {% for key,value in p_selUnidades %}
  86.                             <option value="{{ key }}" {{ key == numItemsPerPage ? 'selected' : '' }}>{{ value }}</option>
  87.                         {% endfor %}
  88.                     </select>
  89.                 {% endif %}
  90.             </div>
  91.         {% endif %}
  92.     </div>
  93. </div>