diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-11-19 02:38:09 +0100 |
---|---|---|
committer | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-11-19 02:48:45 +0100 |
commit | dacfc5fe13dc6b46fa90e5ef9fb07509afd5d777 (patch) | |
tree | 105012c6c041d9bc98045846dd82c6ab262875cd /templates/_pagination.html | |
parent | 2d04a1bd8efe3c440ecf66a22b3ae138ed8eaabe (diff) | |
download | padlite-teams-dacfc5fe13dc6b46fa90e5ef9fb07509afd5d777.tar.gz padlite-teams-dacfc5fe13dc6b46fa90e5ef9fb07509afd5d777.tar.bz2 padlite-teams-dacfc5fe13dc6b46fa90e5ef9fb07509afd5d777.zip |
templates/all: add paginated list of all browsable groups
Diffstat (limited to 'templates/_pagination.html')
-rw-r--r-- | templates/_pagination.html | 27 |
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) }}">«</a></li> + {% else %} + <li class="disabled"><a href="#">«</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) }}">»</a></li> + {% else %} + <li class="disabled"><a href="#">»</a></li> + {% endif %} +</ul> +{% endmacro %} |