summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2014-11-19 02:38:09 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2014-11-19 02:48:45 +0100
commitdacfc5fe13dc6b46fa90e5ef9fb07509afd5d777 (patch)
tree105012c6c041d9bc98045846dd82c6ab262875cd /templates
parent2d04a1bd8efe3c440ecf66a22b3ae138ed8eaabe (diff)
downloadpadlite-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')
-rw-r--r--templates/_pagination.html27
-rw-r--r--templates/all.html22
-rw-r--r--templates/index.html4
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) }}">&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 %}
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">