{% extends "withnav_template.html" %} {% from "components/banner.html" import banner_wrapper %} {% from "components/radios.html" import radio_select %} {% from "components/table.html" import list_table, field, text_field, index_field, hidden_field_heading %} {% from "components/file-upload.html" import file_upload %} {% from "components/back-link/macro.njk" import govukBackLink %} {% from "components/message-count-label.html" import message_count_label %} {% set file_contents_header_id = 'file-preview' %} {% macro skip_to_file_contents() %}

Skip to file contents

{% endmacro %} {% block service_page_title %} Error {% endblock %} {% block maincolumn_content %} {{ govukBackLink({ "href": url_for('main.upload_contact_list', service_id=current_service.id) }) }}
{% call banner_wrapper(type='dangerous') %} {% if not recipients|length %}

Your file is missing some rows

It needs at least one row of data {%- if template_type %}.{% else %}, in a column called ‘email address’ or ‘phone number’.{% endif %}

{% elif recipients.column_headers|length == 1 %}

Your file needs a column called ‘email address’ or ‘phone number’.

Right now it has 1 column called ‘{{ recipients._raw_column_headers[0] }}’.

{% else %}

Your file has too many columns

It needs to have 1 column, called ‘email address’ or ‘phone number’.

Right now it has {{ recipients._raw_column_headers|length }} columns called {{ recipients._raw_column_headers | formatted_list }}.

{% endif %} {{ skip_to_file_contents() }} {% endcall %}
{{ file_upload( form.file, action=url_for('.upload_contact_list', service_id=current_service.id), button_text='Upload your file again' ) }}
Back to top
{% set column_headers = recipients._raw_column_headers if recipients.duplicate_recipient_column_headers else recipients.column_headers %}

{{ original_file_name }}

{% call(item, row_number) list_table( recipients.displayed_rows, caption=original_file_name, caption_visible=False, field_headings=[ 'Row in file '|safe ] + recipients._raw_column_headers ) %} {{ index_field(item.index + 2) }} {% for column in column_headers %} {% if item[column].ignore %} {{ text_field(item[column].data or '', status='default') }} {% else %} {{ text_field(item[column].data or '') }} {% endif %} {% endfor %} {% if item[None].data %} {% for column in item[None].data %} {{ text_field(column, status='default') }} {% endfor %} {% endif %} {% endcall %}
{% if recipients.displayed_rows|list|length < recipients|length %} {% endif %} {% endblock %}