Merge pull request #213 from alphagov/accept-phone-or-email-column

Accept CSVs with 'email address' or 'phone number'
This commit is contained in:
NIcholas Staples
2016-03-02 11:27:24 +00:00
6 changed files with 48 additions and 30 deletions

View File

@@ -61,13 +61,17 @@
caption=original_file_name,
field_headings=column_headers
) %}
{% if item.to or ''|valid_phone_number %}
{% if item.get('phone number', '')|valid_phone_number %}
{% call field() %}
{{ item.to }}
{{ item['phone number'] }}
{% endcall %}
{% elif item.get('email address') %}
{% call field() %}
{{ item['email address'] }}
{% endcall %}
{% else %}
{% call field(status='missing') %}
{{ item.to }}
{{ item['phone number'] }}
{% endcall %}
{% endif %}
{% for column in template.placeholders %}

View File

@@ -40,7 +40,7 @@
{% endif %}
</p>
<p class="bottom-gutter-2-3">
<span class='placeholder'>to</span>
<span class='placeholder'>{{ recipient_column }}</span>
{{ template.placeholders_as_markup|join(" ") }}
</p>
<p>