diff --git a/app/assets/stylesheets/components/table.scss b/app/assets/stylesheets/components/table.scss index 085b16e6f..7d1931395 100644 --- a/app/assets/stylesheets/components/table.scss +++ b/app/assets/stylesheets/components/table.scss @@ -74,6 +74,12 @@ } + &-invisible-error { + border-left: 5px solid transparent; + padding-left: 7px; + display: block; + } + &-status { &-default { @@ -123,6 +129,7 @@ } &-index { + @include bold-16; width: 15px; } @@ -132,6 +139,10 @@ } +.table-font-xsmall td.table-field-index { // overrides GOV.UK Elements + @include bold-16; +} + .table-field-headings, .table-field-headings-visible { 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 bb9c4012c..d7819fca2 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -190,14 +190,18 @@ caption=original_file_name, caption_visible=False, field_headings=[ - 'Row in file'|safe + 'Row in file'.format("table-field-invisible-error" if errors else "")|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
', (