mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-30 19:29:43 -04:00
Merge pull request #1215 from alphagov/fix-address-column-handling
Fix address column handling
This commit is contained in:
@@ -77,7 +77,6 @@ def get_example_letter_address(key):
|
||||
return {
|
||||
'address line 1': 'A. Name',
|
||||
'address line 2': '123 Example Street',
|
||||
'address line 3': 'Example town',
|
||||
'postcode': 'XM4 5HQ'
|
||||
}.get(key, '')
|
||||
|
||||
|
||||
@@ -287,13 +287,17 @@ def edit_service_template(service_id, template_id):
|
||||
}, current_service)
|
||||
template_change = get_template(template, current_service).compare_to(new_template)
|
||||
if template_change.has_different_placeholders and not request.form.get('confirm'):
|
||||
example_column_headings = (
|
||||
first_column_headings[new_template.template_type] +
|
||||
list(new_template.placeholders)
|
||||
)
|
||||
return render_template(
|
||||
'views/templates/breaking-change.html',
|
||||
template_change=template_change,
|
||||
new_template=new_template,
|
||||
column_headings=list(ascii_uppercase[:len(new_template.placeholders) + 1]),
|
||||
column_headings=list(ascii_uppercase[:len(example_column_headings)]),
|
||||
example_rows=[
|
||||
first_column_headings[new_template.template_type] + list(new_template.placeholders),
|
||||
example_column_headings,
|
||||
get_example_csv_rows(new_template),
|
||||
get_example_csv_rows(new_template)
|
||||
],
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
|
||||
<p>
|
||||
When you send messages using this template you’ll need
|
||||
{{ new_template.placeholders|length + 1 }}
|
||||
column{{ 's' if new_template.placeholders|length > 0 else '' }} of data:
|
||||
{{ column_headings|length }}
|
||||
column{{ 's' if column_headings|length > 1 else '' }} of data:
|
||||
</p>
|
||||
|
||||
<div class="spreadsheet">
|
||||
|
||||
Reference in New Issue
Block a user