pagination.html
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{% load i18n %}
{% if page.paginator.num_pages > 1 %}
<div class="pagination">
{% if page.has_previous %}
<a href="{{ alterpath }}{{ page.previous_page_url }}">« {% trans "previous" %}</a>
{% else %}
<span class="control">« {% trans "previous" %}</span>
{% endif %}
{% if page.paginator.frame_start_page > 1 %}
<a href="{{ alterpath }}{{ page.first_page_url }}">1</a>
{% if page.paginator.frame_start_page > 2 %}
<span class="control">...</span>
{% endif %}
{% endif %}
{% for number, url in page.paginator.frame %}
{% if not url %}..{% else %}
<a {% ifequal page.number number%}class="active"{% endifequal %} href="{{ alterpath }}{{ url }}">{{ number }}</a>
{% endif %}
{% endfor %}
{% if page.paginator.frame_end_page != page.paginator.num_pages %}
{% if page.paginator.frame_end_page != page.paginator.num_pages|add:"-1" %}
<span class="control">...</span>
{% endif %}
<a href="{{ alterpath }}{{ page.last_page_url }}">{{ page.paginator.num_pages }}</a>
{% endif %}
{% if page.has_next %}
<a href="{{ alterpath }}{{ page.next_page_url }}">{% trans "next" %} »</a>
{% else %}
<span class="control">{% trans "next" %} »</span>
{% endif %}
<div class="clear"></div>
</div>
{% endif %}