From e2c023915559b1230cf19a06734c6f5ed76148e3 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 25 Jan 2021 18:22:49 -0800 Subject: html: fix pagination box on mobile --- fatcat_scholar/templates/search.html | 12 ++++++++---- fatcat_scholar/templates/search_macros.html | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'fatcat_scholar/templates') diff --git a/fatcat_scholar/templates/search.html b/fatcat_scholar/templates/search.html index 2f2149e..5c7d860 100644 --- a/fatcat_scholar/templates/search.html +++ b/fatcat_scholar/templates/search.html @@ -120,8 +120,10 @@ {% elif hits and hits.results %} {% if hits.results %} {% if hits.offset != 0 %} -
- {{ search_macros.search_pagination(hits) }} +
+
+ {{ search_macros.search_pagination(hits) }} +
{% endif %} @@ -132,8 +134,10 @@ {% endfor %} {% if hits.count_found > hits.limit %} -
- {{ search_macros.search_pagination(hits) }} +
+
+ {{ search_macros.search_pagination(hits) }} +
{% endif %} {% endif %} diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 0e6b3f0..5552dc3 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -489,24 +489,26 @@ {% macro search_pagination(hits, top) %} {% if hits.offset > 0 %} - {% else %} - « {% trans %}Previous{% endtrans %} + « {% trans %}Previous{% endtrans %} {% endif %} + +{% if hits.offset + hits.limit < hits.count_found %} + +{% else %} + {% trans %}Next{% endtrans %} » +{% endif %} + {% trans trimmed start=(hits.offset + 1), end=(hits.offset + hits.limit), total="{:,}".format(hits.count_found) %} Showing results {{ start }} — {{ end }} out of {{ total }} results {% endtrans %} -{% if hits.offset + hits.limit < hits.count_found %} - {% endmacro %} {% macro query_option(options, selected) -%} -- cgit v1.2.3