Skip to content

Commit

Permalink
Merge pull request #1001 from ecds/bugfix/945-page-number
Browse files Browse the repository at this point in the history
Don't add 1 to canvas position in search results (#945)
  • Loading branch information
jayvarner authored Dec 7, 2023
2 parents fb3f639 + 9339ae2 commit 79d3ba4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/ingest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def open_metadata(self):

def create_canvases(self):
# TODO: What if there are multiple sequences? Is that even allowed in IIIF?
for position, sc_canvas in enumerate(self.remote_manifest['sequences'][0]['canvases']):
for position, sc_canvas in enumerate(self.remote_manifest['sequences'][0]['canvases'], start=1):
canvas_metadata = None
# TODO: we will need some sort of check for IIIF API version, but not
# everyone includes a context for each canvas.
Expand Down
2 changes: 1 addition & 1 deletion apps/templates/snippets/volume_result.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h4>
{% for canvas in volume.meta.inner_hits|group_by_canvas %}
<dd class="result-page">
<a href="{% url 'page' volume=volume.pid page=canvas.pid %}">
<span class="page-number">p. {{ canvas.position|add:1 }}</span>
<span class="page-number">p. {{ canvas.position }}</span>
{% if canvas.highlights|length %}
<ul class="highlights">
{% for fragment in canvas.highlights %}
Expand Down

0 comments on commit 79d3ba4

Please sign in to comment.