Make row in URL match displayed row

Spreadsheets start at row 1 (the header row), and the values don’t start
until row 2. The row numbers in our URLs start at 0, which is a concept
that only makes sense to programmers.

It’s more predictable and consistent to make the number in the URL match
the row number displayed on the page when previewing the spreadsheet.
This commit is contained in:
Chris Hill-Scott
2018-01-15 11:35:45 +00:00
parent b95a7403b4
commit 072f8e0f87
3 changed files with 20 additions and 14 deletions

View File

@@ -60,10 +60,10 @@
) %}
{% call index_field() %}
<span>
{% if item.index == preview_row %}
{% if (item.index + 2) == preview_row %}
{{ item.index + 2 }}
{% else %}
<a href="{{ url_for('.check_messages', service_id=current_service.id, template_type=template.template_type, upload_id=upload_id, row_index=(item.index)) }}">{{ item.index + 2 }}</a>
<a href="{{ url_for('.check_messages', service_id=current_service.id, template_type=template.template_type, upload_id=upload_id, row_index=(item.index + 2)) }}">{{ item.index + 2 }}</a>
{% endif %}
</span>
{% endcall %}