src/JuridicusBundle/Resources/views/Pruefung/pagination.html.twig line 1

Open in your IDE?
  1. {% if current_page is defined %}
  2. <style>
  3. .page-link {
  4. position: relative;
  5. display: block;
  6. padding: .5rem .75rem;
  7. margin-left: -1px;
  8. line-height: 1.25;
  9. color: black !important;
  10. background-color: #fff;
  11. border: 1px solid #c3d138 !important;
  12. }
  13. .page-item.active .page-link {
  14. z-index: 1;
  15. color: #fff;
  16. background-color: #c3d138 !important;
  17. border-color: #c3d138 !important;
  18. }
  19. </style>
  20. <nav aria-label="Pagination">
  21. <ul class="pagination">
  22. {% if current_page == 1 %}
  23. <li class="page-item disabled"><a class="page-link" href="{{ path('termine', { 'page': previous_page }) }}">&laquo;</a></li>
  24. {% else %}
  25. <li class="page-item"><a class="page-link" href="{{ path('termine', { 'page': previous_page }) }}">&laquo;</a></li>
  26. {% endif %}
  27. {% if current_page > 10 %}
  28. {% set from = current_page-10 %}
  29. {% else %}
  30. {% set from = 1 %}
  31. {% endif %}
  32. {% if last_page-current_page > 10 %}
  33. {% set to = current_page+10 %}
  34. {% else %}
  35. {% set to = last_page %}
  36. {% endif %}
  37. {% for page in from..to %}
  38. {% if page == current_page %}
  39. <li class="page-item active"><a class="page-link" href="{{ path('termine', { 'page': page }) }}">{{ page }}</a></li>
  40. {% else %}
  41. <li class="page-item"><a class="page-link" href="{{ path('termine', { 'page': page }) }}">{{ page }}</a></li>
  42. {% endif %}
  43. {% endfor %}
  44. {% if current_page == last_page %}
  45. <li class="page-item disabled"><a class="page-link" href="{{ path('termine', { 'page': next_page }) }}">&raquo;</a></li>
  46. {% else %}
  47. <li class="page-item"><a class="page-link" href="{{ path('termine', { 'page': next_page }) }}">&raquo;</a></li>
  48. {% endif %}
  49. </ul>
  50. </nav>
  51. {% endif %}