Example usage of BetterPaginator
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | {% spaceless %}
{% if paginator.has_previous_page %}
<a class="paginator arrow" href="{{ paginator.previous_link }}">« Previous</a>
{% else %}
<span class="paginator disabled arrow">« Previous</span>
{% endif %}
<!-- {{ paginator.start_index }} - {{ paginator.end_index }} of {{ paginator.hits }} -->
{% for set in paginator.windowed_page_links %}
{% if not forloop.first %}...{% endif %}
{% for p in set %}
{% if p.2 %}
<span class="paginator current_page">{{ p.0 }}</span>
{% else %}
<a class="paginator" href ="{{ p.1 }}">{{ p.0 }}</a>
{% endif %}
{% endfor %}
{% endfor %}
{% if paginator.has_next_page %}
<a class="paginator arrow" href="{{ paginator.next_link }}">Next »</a>
{% else %}
<span class="paginator disabled arrow">Next »</span>
{% endif %}
{% endspaceless %}
|
More like this
- Template tag - list punctuation for a list of items by shapiromatron 10 months, 3 weeks ago
- JSONRequestMiddleware adds a .json() method to your HttpRequests by cdcarter 11 months ago
- Serializer factory with Django Rest Framework by julio 1 year, 5 months ago
- Image compression before saving the new model / work with JPG, PNG by Schleidens 1 year, 6 months ago
- Help text hyperlinks by sa2812 1 year, 7 months ago
Comments
Please login first before commenting.