3799314e4f529fd0ea94fdb4ec9ec9b835de94cc
[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 }}{{ getvars }}" class="prev">&lsaquo;&lsaquo; previous</a>
5     {% else %}
6         <span class="disabled prev">&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">{{ page }}</span>
12             {% else %}
13                 <a href="?page={{ page }}{{ getvars }}" class="page">{{ 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 }}{{ getvars }}" class="next">next &rsaquo;&rsaquo;</a>
21     {% else %}
22         <span class="disabled next">next &rsaquo;&rsaquo;</span>
23     {% endif %}
24 </div>
25 {% endif %}