From ad5fc9a5831c68bd384186fc6c0f98a48fb20963 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 23 May 2017 14:21:59 +0100 Subject: [PATCH] Put error flag on whole row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’ve seen people miss errors if they’re in the right-hand columns of the spreadsheet because people’s eyes scan down the left edge of the table. --- app/templates/components/table.html | 4 ++-- app/templates/views/check.html | 8 ++++++-- tests/app/main/views/test_send.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/templates/components/table.html b/app/templates/components/table.html index 2925ee2f2..2697cc6f6 100644 --- a/app/templates/components/table.html +++ b/app/templates/components/table.html @@ -73,9 +73,9 @@ {%- endmacro %} -{% macro index_field(text) -%} +{% macro index_field(text=None) -%} - {{ text }} + {{ text if text != None else caller() }} {%- endmacro %} diff --git a/app/templates/views/check.html b/app/templates/views/check.html index 933bda753..5fd5590c0 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -191,11 +191,15 @@ 'Row in file'|safe ] + recipients.column_headers ) %} - {{ index_field(item.index + 2) }} + {% call index_field() %} + + {{ item.index + 2 }} + + {% endcall %} {% for column in recipients.column_headers %} {% if item['columns'][column].error and not recipients.missing_column_headers %} {% call field() %} - + {{ item['columns'][column].error }} {{ item['columns'][column].data if item['columns'][column].data != None }} diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index a90d690f1..83a25adc7 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -255,7 +255,7 @@ def test_upload_valid_csv_shows_file_contents( assert response.status_code == 200 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') for index, cell in enumerate([ - ' 2 ', + ' 2 ', '
07700900986
', '
Jo
', (