summaryrefslogtreecommitdiff
path: root/src/jwebmail/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/jwebmail/templates')
-rw-r--r--src/jwebmail/templates/_bot_nav.html38
-rw-r--r--src/jwebmail/templates/_nav.html22
-rw-r--r--src/jwebmail/templates/_top_nav.html38
3 files changed, 24 insertions, 74 deletions
diff --git a/src/jwebmail/templates/_bot_nav.html b/src/jwebmail/templates/_bot_nav.html
index 03cb939..a1e1b76 100644
--- a/src/jwebmail/templates/_bot_nav.html
+++ b/src/jwebmail/templates/_bot_nav.html
@@ -1,43 +1,7 @@
<div class="columns">
<div class=column>
- <nav class="pagination" role="navigation">
- {% if first %}
- <a class="pagination-previous" disabled>&laquo;</a>
- {% else %}
- <a class="pagination-previous"
- href="{{ url_for(
- 'displayheaders',
- folder=request.view_args.folder,
- page_bound=page_bound_before,
- page_after=0,
- per_page=request.args.get('per_page'),
- sort=request.args.get('sort'),
- search=request.args.get('search'),
- ) }}"
- aria-label="Next">
- &laquo;
- </a>
- {% endif %}
-
- {% if last %}
- <a class="pagination-next" disabled>&raquo;</a>
- {% else %}
- <a class="pagination-next"
- href="{{ url_for(
- 'displayheaders',
- folder=request.view_args.folder,
- page_bound=page_bound_after,
- page_after=1,
- per_page=request.args.get('per_page'),
- sort=request.args.get('sort'),
- search=request.args.get('search'),
- ) }}"
- aria-label="Next">
- &raquo;
- </a>
- {% endif %}
- </nav>
+ {% include '_nav.html' %}
</div>
<div class="column">
diff --git a/src/jwebmail/templates/_nav.html b/src/jwebmail/templates/_nav.html
new file mode 100644
index 0000000..79b7b6e
--- /dev/null
+++ b/src/jwebmail/templates/_nav.html
@@ -0,0 +1,22 @@
+<nav class="pagination" role="navigation">
+ {% set args = dict(request.args) %}
+ {% do args.update(request.view_args) %}
+
+ {% if first %}
+ <a class="pagination-previous" disabled>&laquo;</a>
+ {% else %}
+ {% do args.update([('page_bound', page_bound_before), ('page_after', 0)]) %}
+ <a class="pagination-previous" href="{{ url_for(request.endpoint, **args) }}" aria-label="Previous">
+ &laquo;
+ </a>
+ {% endif %}
+
+ {% if last %}
+ <a class="pagination-next" disabled>&raquo;</a>
+ {% else %}
+ {% do args.update([('page_bound', page_bound_after), ('page_after', 1)]) %}
+ <a class="pagination-next" href="{{ url_for(request.endpoint, **args) }}" aria-label="Next">
+ &raquo;
+ </a>
+ {% endif %}
+</nav>
diff --git a/src/jwebmail/templates/_top_nav.html b/src/jwebmail/templates/_top_nav.html
index c94918c..4e5bcb9 100644
--- a/src/jwebmail/templates/_top_nav.html
+++ b/src/jwebmail/templates/_top_nav.html
@@ -41,43 +41,7 @@
</form>
<div class=column>
- <nav class="pagination" role="navigation">
- {% if first %}
- <a class="pagination-previous" disabled>&laquo;</a>
- {% else %}
- <a class="pagination-previous"
- href="{{ url_for(
- 'displayheaders',
- folder=request.view_args.folder,
- page_bound=page_bound_before,
- page_after=0,
- per_page=request.args.get('per_page'),
- sort=request.args.get('sort'),
- search=request.args.get('search'),
- ) }}"
- aria-label="Next">
- &laquo;
- </a>
- {% endif %}
-
- {% if last %}
- <a class="pagination-next" disabled>&raquo;</a>
- {% else %}
- <a class="pagination-next"
- href="{{ url_for(
- 'displayheaders',
- folder=request.view_args.folder,
- page_bound=page_bound_after,
- page_after=1,
- per_page=request.args.get('per_page'),
- sort=request.args.get('sort'),
- search=request.args.get('search'),
- ) }}"
- aria-label="Next">
- &raquo;
- </a>
- {% endif %}
- </nav>
+ {% include '_nav.html' %}
</div>
</div>