From 116a47f6057245159851ff204f9e4c1e643c3d8d Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 13 Nov 2019 16:58:09 +0100 Subject: move pagination into macros Two new macros: * top_results(found) * bottom_results(found) wip: move pagination into macro --- python/fatcat_web/templates/container_search.html | 27 +++++------------------ 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'python/fatcat_web/templates/container_search.html') diff --git a/python/fatcat_web/templates/container_search.html b/python/fatcat_web/templates/container_search.html index 9e2aa10a..48c613f8 100644 --- a/python/fatcat_web/templates/container_search.html +++ b/python/fatcat_web/templates/container_search.html @@ -1,3 +1,4 @@ +{% import "entity_macros.html" as entity_macros %} {% extends "base.html" %} {% block title %} @@ -30,25 +31,7 @@ {% if found %} {% if found.results %} - Showing - {% if found.offset == 0 %} - first - {% else %} - results {{ found.offset }} — - {% endif %} - {{ found.offset + found.count_returned }} out of {{ found.count_found }} results for: {{ found.query.q }} -
- {% if found.offset > 0 %} - {% if found.offset - found.limit < 0 %} - Prev - {% else %} - Prev - {% endif %} - {% endif %} - - {% if found.offset + found.limit < found.count_found and found.offset + found.limit < found.deep_page_limit %} - Next - {% endif %} + {{ entity_macros.top_results(found) }} {% for entity in found.results %}
@@ -68,8 +51,10 @@
{% endfor %} {% if found.results|length > 8 %} -
- Showing top {{ found.count_returned }} out of {{ found.count_found }} results for: {{ found.query.q }} +
+
+ {{ entity_macros.bottom_results(found)}} +
{% endif %} {% else %} -- cgit v1.2.3