templates/pagination/pagination.html.twig line 1

  1. {# tailwindcss Sliding pagination control implementation #}
  2. {% if pageCount > 1 %}
  3.     <div class="inline-block">
  4.         <div class="flex items-center w-auto gap-2">
  5.         {# {% if first is defined and current != first %}
  6.             <span role="button" class="border border-neutral-200 text-neutral rounded p-4 inline-flex items-center justify-center">
  7.                 <a href="{{ path(route, query|merge({(pageParameterName): first})) }}">&lt;&lt;</a>
  8.             </span>
  9.         {% endif %} #}
  10.         {% if previous is defined %}
  11.             <a class="border border-neutral-200 text-neutral text-base rounded p-2 w-12 h-12 inline-flex items-center justify-center hover:border-brand hover:font-medium" rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">
  12.               &lt;
  13.             </a>
  14.         {% endif %}
  15.         {% for page in pagesInRange %}
  16.             {% if page != current %}
  17.                 <a
  18.                   href="{{ path(route, query|merge({(pageParameterName): page})) }}"
  19.                   class="border border-neutral-200 text-neutral text-base rounded p-2 w-12 h-12 inline-flex items-center justify-center hover:border-brand hover:font-medium"
  20.                 >
  21.                   {{ page }}
  22.                 </a>
  23.             {% else %}
  24.                 <span
  25.                   class="bg-brand font-medium border border-brand text-white text-base rounded p-2 w-12 h-12 inline-flex items-center justify-center"
  26.                 >
  27.                     {{ page }}
  28.                 </span>
  29.             {% endif %}
  30.         {% endfor %}
  31.         {% if next is defined %}
  32.             <a class="border border-neutral-200 text-neutral text-base rounded p-2 w-12 h-12 inline-flex items-center justify-center hover:border-brand hover:font-medium" rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">
  33.               &gt;
  34.             </a>
  35.         {% endif %}
  36.         {# {% if last is defined and current != last %}
  37.             <span role="button" class="border border-neutral-200 text-neutral rounded p-4 inline-flex items-center justify-center">
  38.                 <a href="{{ path(route, query|merge({(pageParameterName): last})) }}">&gt;&gt;</a>
  39.             </span>
  40.         {% endif %} #}
  41.         </div>
  42.     </div>
  43. {% endif %}