diff options
Diffstat (limited to 'lib/pagination/templates')
-rw-r--r-- | lib/pagination/templates/pagination/pagination.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/pagination/templates/pagination/pagination.html b/lib/pagination/templates/pagination/pagination.html new file mode 100644 index 0000000..2ecffb4 --- /dev/null +++ b/lib/pagination/templates/pagination/pagination.html @@ -0,0 +1,30 @@ +{% load pagination_tags %} +{% if is_paginated %} +<div class="pagination"> + {% if page_obj.has_previous %} + <a href="{% if use_page_path %}{% page_path prev_page %}{% else %}?page={{ page_obj.previous_page_number }}{{ getvars }}{% endif %}" class="prev">‹‹ previous</a> + {% else %} + <span class="disabled prev"></span> + {% endif %} + {% for page in pages %} + {% if page %} + {% ifequal page page_obj.number %} + <span class="current page">{{ page }}</span> + {% else %} + {% if use_page_path %} + <a href="{% page_path page %}" class="page">{{ page }}</a> + {% else %} + <a href="?page={{ page }}{{ getvars }}" class="page">{{ page }}</a> + {% endif %} + {% endifequal %} + {% else %} + ... + {% endif %} + {% endfor %} + {% if page_obj.has_next %} + <a href="{% if use_page_path %}{% page_path next_page %}{% else %}?page={{ page_obj.next_page_number }}{{ getvars }}{% endif %}" class="next">next ››</a> + {% else %} + <span class="disabled next">next ››</span> + {% endif %} +</div> +{% endif %} |