summaryrefslogtreecommitdiffstats
path: root/templates/_pagination.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/_pagination.html')
-rw-r--r--templates/_pagination.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/templates/_pagination.html b/templates/_pagination.html
new file mode 100644
index 0000000..f53df57
--- /dev/null
+++ b/templates/_pagination.html
@@ -0,0 +1,27 @@
+{% macro render_pagination(pagination) %}
+<ul class="pagination" style="margin-top: 5px; margin-bottom: 0; padding: 0">
+ {% if pagination.has_prev %}
+ <li><a href="{{ url_for_other_page(pagination.page - 1) }}">&laquo;</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">&laquo;</a></li>
+ {% endif %}
+
+ {%- for page in pagination.iter_pages(1, 4, 4, 1) %}
+ {% if page %}
+ {% if page != pagination.page %}
+ <li><a href="{{ url_for_other_page(page) }}">{{ page }}</a></li>
+ {% else %}
+ <li class="active"><a href="#">{{ page }}</a></li>
+ {% endif %}
+ {% else %}
+ <li class="disabled"><a href="#">…</a></li>
+ {% endif %}
+ {%- endfor %}
+
+ {% if pagination.has_next %}
+ <li><a href="{{ url_for_other_page(pagination.page + 1) }}">&raquo;</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">&raquo;</a></li>
+ {% endif %}
+</ul>
+{% endmacro %}