From 7315951baaa3c3d3a1e1c70b26adfe74b86941f7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 18 Nov 2020 12:06:54 -0800 Subject: web: fix pagination numbering lower-bound Offset/limit are zero-indexed in code, with lower bound inclusive and upper bound exclusive. But we should display as one-indexed, with lower and upper bounds exclusive. Eg, first three hits are "1 to 3" (not "0 to 3") and next three are "4 to 6" (not "3 to 6"). Thanks to @milotype for catching this. --- fatcat_scholar/templates/search_macros.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fatcat_scholar/templates/search_macros.html') diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 0c35dd4..d3dc854 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -311,7 +311,7 @@ « {% trans %}Previous{% endtrans %} {% endif %} - {% trans trimmed start=hits.offset, end=(hits.offset + hits.limit), total="{:,}".format(hits.count_found) %} + {% 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 %} -- cgit v1.2.3