2
0

pagination.html 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. {% load navigation_tags %}
  2. <nav class="pagination" aria-label="Pagination">
  3. <ul class="pagination__list">
  4. {% if subpages.has_previous %}
  5. <li class="page-item">
  6. <a href="?page={{ subpages.previous_page_number }}" class="page-link previous arrows">previous</a>
  7. </li>
  8. {% else %}
  9. <li class="page-item disabled">
  10. <a class="page-link">previous</a>
  11. </li>
  12. {% endif %}
  13. {% for i in subpages.paginator.page_range %}
  14. {% if subpages.number == i %}
  15. <li class="page-item active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
  16. {% else %}
  17. <li class="page-item"><a href="?page={{ query_string|urlencode }}&amp;page={{ i }}" class="page-link">{{ i }}</a></li>
  18. {% endif %}
  19. {% endfor %}
  20. {% if subpages.has_next %}
  21. <li class="page-item">
  22. <a href="?page={{ subpages.next_page_number }}" class="page-link next arrows">next</a>
  23. </li>
  24. {% else %}
  25. <li class="page-item disabled">
  26. <a class="page-link">next</a>
  27. </li>
  28. {% endif %}
  29. </ul>
  30. </nav>