From 5c683f7946950d4b510f177155913d725551b96b Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 23 Feb 2017 15:53:16 +0000 Subject: [PATCH 1/2] Use better column heading for screenreaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a screenreader user navigates a table, they use the columns headings to orientate themselves. A column heading of ‘1’ is not helpful. So this commit adds some hidden text for screenreader users, which tells them exactly what the column contains: the number of the row in the original file. --- app/templates/views/check.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/templates/views/check.html b/app/templates/views/check.html index b8880fe30..6c4873a7d 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -170,7 +170,9 @@ recipients.initial_annotated_rows_with_errors if row_errors and not recipients.missing_column_headers else recipients.initial_annotated_rows, caption=original_file_name, caption_visible=False, - field_headings=['1'] + recipients.column_headers + field_headings=[ + 'Row in file'|safe + ] + recipients.column_headers ) %} {{ index_field(item.index + 2) }} {% for column in recipients.column_headers %} From 416bb4d934d9127f74bd814653e3ef8a1a289efd Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 23 Feb 2017 16:03:50 +0000 Subject: [PATCH 2/2] Revert "Add extra text to label rows for screenreaders" This reverts commit 549695de4e5ebc317d6584134c389d062055fb18. This was not the correct solution to the problem identified. --- app/templates/components/table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/components/table.html b/app/templates/components/table.html index b21fc3dc9..51974483e 100644 --- a/app/templates/components/table.html +++ b/app/templates/components/table.html @@ -73,7 +73,7 @@ {% macro index_field(text) -%} - Row {{ text }} + {{ text }} {%- endmacro %}