Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add 1 to canvas position in search results (#945) #1001

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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