{% extends "withnav_template.html" %} {% from "components/sms-message.html" import sms_message %} {% from "components/table.html" import list_table, field %} {% from "components/placeholder.html" import placeholder %} {% from "components/file-upload.html" import file_upload %} {% from "components/page-footer.html" import page_footer %} {% block page_title %} Check and confirm – GOV.UK Notify {% endblock %} {% block maincolumn_content %} {% if template.additional_data %} {{ banner( "Remove these columns from your CSV file:" + ", ".join(template.missing_data), type="dangerous" ) }} {% elif not upload_result.valid %} {{ banner( "Your CSV file contained missing or invalid data", type="dangerous" ) }} {% endif %}

{{ "Check and confirm" if upload_result.valid else "Send text messages" }}

{% if template.missing_data or template.additional_data %} {{ sms_message(template.formatted_as_markup)}} {% else %} {{ sms_message(template.replaced)}} {% endif %}
{% if upload_result.valid %}
Back
{% else %} {{file_upload(form.file, button_text='Upload a CSV file')}} {% endif %} {% call(item) list_table( upload_result.rows, caption=original_file_name, field_headings=column_headers ) %} {% if item.phone|valid_phone_number %} {% call field() %} {{ item.phone }} {% endcall %} {% else %} {% call field(status='missing') %} {{ item.phone }} {% endcall %} {% endif %} {% for column in template.placeholders %} {% if item.get(column) %} {% call field() %} {{ item.get(column) }} {% endcall %} {% else %} {% call field(status='missing') %} missing {% endcall %} {% endif %} {% endfor %} {% endcall %} {% endblock %}