pagination.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {% if articles_page and articles_paginator.num_pages > 1 %}
  2. {% if USE_PAGER %}
  3. <ul class="pager">
  4. {% if articles_page.has_previous() %}
  5. <li class="previous"><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&larr; Newer</a></li>
  6. {% else %}
  7. <li class="previous disabled"><a href="#">&larr; Newer</a></li>
  8. {% endif %}
  9. {% if articles_page.has_next() %}
  10. <li class="next"><a
  11. href="{{ SITEURL }}/{{ articles_next_page.url }}">Older &rarr;</a></li>
  12. {% else %}
  13. <li class="next disabled"><a href="#">Older &rarr;</a></li>
  14. {% endif %}
  15. </ul>
  16. {% else %}
  17. <ul class="pagination">
  18. {% if articles_page.has_previous() %}
  19. {% set num = articles_page.previous_page_number() %}
  20. <li class="prev"><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&laquo;</a>
  21. </li>
  22. {% else %}
  23. <li class="prev disabled"><a href="#">&laquo;</a></li>
  24. {% endif %}
  25. {% for num in range( 1, 1 + articles_paginator.num_pages ) %}
  26. <li class="{{ 'active' if num == articles_page.number else '' }}"><a
  27. href="{{ SITEURL }}/{{ page_name }}{{ num if num > 1 else '' }}.html">{{ num }}</a></li>
  28. {% endfor %}
  29. {% if articles_page.has_next() %}
  30. <li class="next"><a
  31. href="{{ SITEURL }}/{{ articles_next_page.url }}">&raquo;</a></li>
  32. {% else %}
  33. <li class="next disabled"><a href="#">&raquo;</a></li>
  34. {% endif %}
  35. </ul>
  36. {% endif %}
  37. {% endif %}