summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-11-18 12:06:54 -0800
committerBryan Newbold <bnewbold@archive.org>2020-11-18 12:06:56 -0800
commit7315951baaa3c3d3a1e1c70b26adfe74b86941f7 (patch)
treeecf92f173d409885b6ced5769bad3d4c6ed5d29c
parent00a4be2a3a26b0179598ec2f31e4490563a53622 (diff)
downloadfatcat-scholar-7315951baaa3c3d3a1e1c70b26adfe74b86941f7.tar.gz
fatcat-scholar-7315951baaa3c3d3a1e1c70b26adfe74b86941f7.zip
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.
-rw-r--r--fatcat_scholar/templates/search_macros.html2
1 files changed, 1 insertions, 1 deletions
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 @@
<span style="color:rgba(0,0,0,0.55); margin-right: 2em;">&#xab; {% trans %}Previous{% endtrans %}</span>
{% endif %}
<i>
- {% 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 }} &mdash; {{ end }} out of {{ total }} results
{% endtrans %}
</i>