8dd3679b030cc4c3d8b3fd616d6868224dc62c9a
[django-pagination.git] / pagination / templates / pagination / pagination.html
1 {% if is_paginated %}
2 {% load i18n %}
3 <div class="pagination">
4     {% if page_obj.has_previous %}
5         <a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}" class="prev">{{ previous_link_decorator }}{% trans "previous" %}</a>
6     {% else %}
7         {% if display_disabled_previous_link %}
8             <span class="disabled prev">{{ previous_link_decorator }}{% trans "previous" %}</span>    
9         {% endif %}
10     {% endif %}
11     {% if display_page_links %}
12         {% for page in pages %}
13             {% if page %}
14                 {% ifequal page page_obj.number %}
15                     <span class="current page">{{ page }}</span>
16                 {% else %}
17                     <a href="?page={{ page }}{{ getvars }}{{ hashtag }}" class="page">{{ page }}</a>
18                 {% endifequal %}
19             {% else %}
20                 ...
21             {% endif %}
22         {% endfor %}        
23     {% endif %}
24     {% if page_obj.has_next %}
25         <a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}" class="next">{% trans "next" %}{{ next_link_decorator }}</a>
26     {% else %}
27         {% if display_disabled_next_link %}
28             <span class="disabled next">{% trans "next" %}{{ next_link_decorator }}</span>
29         {% endif %}
30     {% endif %}
31 </div>
32 {% endif %}