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/release_search.html | 27 +++++-------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'python/fatcat_web/templates/release_search.html') diff --git a/python/fatcat_web/templates/release_search.html b/python/fatcat_web/templates/release_search.html index 359038dc..47f4330a 100644 --- a/python/fatcat_web/templates/release_search.html +++ b/python/fatcat_web/templates/release_search.html @@ -36,33 +36,16 @@ {% 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 paper in found.results %} {{ entity_macros.release_search_result_row(paper) }} {% 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