diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_pagination.html | 27 | ||||
-rw-r--r-- | templates/all.html | 22 | ||||
-rw-r--r-- | templates/index.html | 4 |
3 files changed, 53 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 %} diff --git a/templates/all.html b/templates/all.html new file mode 100644 index 0000000..d50bf56 --- /dev/null +++ b/templates/all.html @@ -0,0 +1,22 @@ +{% extends "layout.html" %} +{% from "_pagination.html" import render_pagination %} + +{% block head %}Public groups{% endblock %} + +{% block content %} +<div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title">Public groups</h3> + </div> + + <div class="list-group"> + {% for group in groups %} + <span class="list-group-item">{{group}}</span> + {% endfor %} + </div> + + <div class="panel-footer text-center"> + {{ render_pagination(pagination) }} + </div> +</div> +{% endblock %} diff --git a/templates/index.html b/templates/index.html index c6583a1..1c4e612 100644 --- a/templates/index.html +++ b/templates/index.html @@ -14,6 +14,10 @@ <a class="list-group-item" href="{{ url_for('group', group_name=group.name) }}">{{group}}</a> {% endfor %} </div> + + <div class="panel-footer"> + <a href="{{ url_for('all') }}">Find public browsable groups</a> + </div> </div> <div class="panel panel-default"> |