2013-10-14 10:12:50 +00:00
|
|
|
{% if list.paginator.num_pages > 1 %}
|
|
|
|
<div class="paginator">
|
|
|
|
{% if list.number > 1 %}
|
2014-06-20 19:49:06 +00:00
|
|
|
{% if tag %}
|
|
|
|
<a href="{% url view page=1 tag=tag %}">First</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{% url view page=1 %}">First</a>
|
|
|
|
{% endif %}
|
2013-10-14 10:12:50 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if list.has_previous and list.number != 2 %}
|
2014-06-20 19:49:06 +00:00
|
|
|
{% if tag %}
|
|
|
|
<a href="{% url view page=list.previous_page_number tag=tag %}">Previous</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{% url view page=list.previous_page_number %}">Previous</a>
|
|
|
|
{% endif %}
|
2013-10-14 10:12:50 +00:00
|
|
|
{% endif %}
|
|
|
|
{% for i in posts.paginator.page_range %}
|
2014-06-20 19:49:06 +00:00
|
|
|
{% if tag %}
|
|
|
|
{% if list.number != i %}<a href="{% url view page=i tag=tag %}">{% endif %}{{ i }}{% if list.number != i %}</a>{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% if list.number != i %}<a href="{% url view page=i %}">{% endif %}{{ i }}{% if list.number != i %}</a>{% endif %}
|
|
|
|
{% endif %}
|
2013-10-14 10:12:50 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% if list.has_next and list.number != list.paginator.num_pages|add:-1 %}
|
2014-06-20 19:49:06 +00:00
|
|
|
{% if tag %}
|
|
|
|
<a href="{% url view page=list.next_page_number tag=tag %}">Next</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{% url view page=list.next_page_number %}">Next</a>
|
|
|
|
{% endif %}
|
2013-10-14 10:12:50 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if list.number < list.paginator.num_pages %}
|
2014-06-20 19:49:06 +00:00
|
|
|
{% if tag %}
|
|
|
|
<a href="{% url view page=list.paginator.num_pages tag=tag %}">Last</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{% url view page=list.paginator.num_pages %}">Last</a>
|
|
|
|
{% endif %}
|
2013-10-14 10:12:50 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|