fbb678dc0473c45234c026e2dc0c556a8aa845c5
[django-pagination.git] / pagination / templates / pagination / pagination.html
1 {% if is_paginated %}
2 <div class="pagination">
3     {% if page_obj.has_previous %}
4         <a href="?page={{ page_obj.previous_page_number }}">&lsaquo;&lsaquo; previous</a>
5     {% else %}
6         <span class="disabled">&lsaquo;&lsaquo; previous</span>
7     {% endif %}
8     {% for page in pages %}
9         {% if page %}
10             {% ifequal page page_obj.number %}
11                 <span class="current">{{ page }}</span>
12             {% else %}
13                 <a href="?page={{ page }}{% if q %}&amp;q={{ q }}{% endif %}">{{ page }}</a>
14             {% endifequal %}
15         {% else %}
16         ...
17         {% endif %}
18     {% endfor %}
19     {% if page_obj.has_next %}
20         <a href="?page={{ page_obj.next_page_number }}">next &rsaquo;&rsaquo;</a>
21     {% else %}
22         <span class="disabled">next &rsaquo;&rsaquo;</span>
23     {% endif %}
24 </div>
25 {% endif %}