templates/application/whileresume/website/pagination/pagination.html.twig line 1

Open in your IDE?
  1. {# =========================================================
  2.    PAGINATION WhileResume — design aligné sur le footer
  3.    Compatible KnpPaginator (variables: pageCount, previous, next,
  4.    pagesInRange, current, route, query, pageParameterName)
  5.    ========================================================= #}
  6. <style>
  7.     /* ---------- Pagination WhileResume ---------- */
  8.     .whr-pagination {
  9.         margin: 28px 0 8px;
  10.         padding: 14px 18px;
  11.         display: flex;
  12.         justify-content: center;
  13.     }
  14.     .whr-pagination ul {
  15.         display: inline-flex;
  16.         align-items: center;
  17.         gap: 6px;
  18.         list-style: none;
  19.         padding: 6px;
  20.         margin: 0;
  21.         background: #F9FAFD;
  22.         border-radius: 14px;
  23.         box-shadow: 0 1px 2px rgba(0,0,0,.04);
  24.     }
  25.     .theme-dark .whr-pagination ul {
  26.         background: #2a2a3c;
  27.         box-shadow: none;
  28.     }
  29.     .whr-pagination li { line-height: 1; }
  30.     .whr-pagination a,
  31.     .whr-pagination span.whr-page {
  32.         display: inline-flex;
  33.         align-items: center;
  34.         justify-content: center;
  35.         min-width: 36px;
  36.         height: 36px;
  37.         padding: 0 12px;
  38.         border-radius: 10px;
  39.         font-size: 13px;
  40.         font-weight: 600;
  41.         color: #2c2c46;
  42.         text-decoration: none !important;
  43.         transition: background .2s ease, color .2s ease, transform .15s ease;
  44.     }
  45.     .theme-dark .whr-pagination a,
  46.     .theme-dark .whr-pagination span.whr-page {
  47.         color: #e9e9ef;
  48.     }
  49.     .whr-pagination a:hover {
  50.         background: #fff;
  51.         color: var(--theme-color, #6C3AED);
  52.         transform: translateY(-1px);
  53.     }
  54.     .theme-dark .whr-pagination a:hover {
  55.         background: #34344a;
  56.         color: #fff;
  57.     }
  58.     /* Page active */
  59.     .whr-pagination .whr-active a,
  60.     .whr-pagination a.whr-active {
  61.         background: var(--theme-color, #6C3AED);
  62.         color: #fff !important;
  63.         cursor: default;
  64.         pointer-events: none;
  65.         box-shadow: 0 2px 8px rgba(108, 58, 237, .25);
  66.     }
  67.     /* État disabled (prev/next non disponibles) */
  68.     .whr-pagination .whr-disabled span.whr-page {
  69.         opacity: .35;
  70.         cursor: not-allowed;
  71.     }
  72.     /* Flèches prev / next */
  73.     .whr-pagination .whr-nav svg {
  74.         width: 16px;
  75.         height: 16px;
  76.         stroke: currentColor;
  77.         stroke-width: 2.5;
  78.         fill: none;
  79.         stroke-linecap: round;
  80.         stroke-linejoin: round;
  81.     }
  82.     /* Ellipsis (…) entre numéros si jamais ajouté */
  83.     .whr-pagination .whr-ellipsis {
  84.         min-width: auto;
  85.         padding: 0 6px;
  86.         color: inherit;
  87.         opacity: .5;
  88.         font-weight: 400;
  89.         cursor: default;
  90.     }
  91.     @media (max-width: 575.98px) {
  92.         .whr-pagination { margin: 20px 0 4px; padding: 10px 8px; }
  93.         .whr-pagination a,
  94.         .whr-pagination span.whr-page {
  95.             min-width: 32px;
  96.             height: 32px;
  97.             padding: 0 9px;
  98.             font-size: 12px;
  99.         }
  100.     }
  101. </style>
  102. {% if pageCount > 1 %}
  103.     <nav class="whr-pagination" role="navigation" aria-label="Pagination">
  104.         <ul>
  105.             {# === Prev === #}
  106.             {% if previous is defined %}
  107.                 <li class="whr-nav">
  108.                     <a href="{{ path(route, query|merge({(pageParameterName): previous})) }}"
  109.                        aria-label="{{ 'pagination.previous'|trans({}, 'whr-public')|default('Précédent') }}"
  110.                        rel="prev">
  111.                         <svg viewBox="0 0 24 24" aria-hidden="true">
  112.                             <polyline points="15 18 9 12 15 6"></polyline>
  113.                         </svg>
  114.                     </a>
  115.                 </li>
  116.             {% else %}
  117.                 <li class="whr-nav whr-disabled" aria-hidden="true">
  118.                     <span class="whr-page">
  119.                         <svg viewBox="0 0 24 24" aria-hidden="true">
  120.                             <polyline points="15 18 9 12 15 6"></polyline>
  121.                         </svg>
  122.                     </span>
  123.                 </li>
  124.             {% endif %}
  125.             {# === Pages === #}
  126.             {% for page in pagesInRange %}
  127.                 {% if page != current %}
  128.                     <li>
  129.                         <a href="{{ path(route, query|merge({(pageParameterName): page})) }}"
  130.                            aria-label="{{ 'pagination.page'|trans({}, 'whr-public')|default('Page') }} {{ page }}">
  131.                             {{ page }}
  132.                         </a>
  133.                     </li>
  134.                 {% else %}
  135.                     <li class="whr-active">
  136.                         <a href="#" class="whr-active" aria-current="page">{{ page }}</a>
  137.                     </li>
  138.                 {% endif %}
  139.             {% endfor %}
  140.             {# === Next === #}
  141.             {% if next is defined %}
  142.                 <li class="whr-nav">
  143.                     <a href="{{ path(route, query|merge({(pageParameterName): next})) }}"
  144.                        aria-label="{{ 'pagination.next'|trans({}, 'whr-public')|default('Suivant') }}"
  145.                        rel="next">
  146.                         <svg viewBox="0 0 24 24" aria-hidden="true">
  147.                             <polyline points="9 6 15 12 9 18"></polyline>
  148.                         </svg>
  149.                     </a>
  150.                 </li>
  151.             {% else %}
  152.                 <li class="whr-nav whr-disabled" aria-hidden="true">
  153.                     <span class="whr-page">
  154.                         <svg viewBox="0 0 24 24" aria-hidden="true">
  155.                             <polyline points="9 6 15 12 9 18"></polyline>
  156.                         </svg>
  157.                     </span>
  158.                 </li>
  159.             {% endif %}
  160.         </ul>
  161.     </nav>
  162. {% endif %}