diff --git a/app/main/views/send.py b/app/main/views/send.py index e7a8a9447..b4379973e 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -31,19 +31,6 @@ from app import job_api_client, service_api_client, current_service, user_api_cl from app.utils import user_has_permissions, get_errors_for_csv, Spreadsheet -def get_send_button_text(template_type, number_of_messages): - if 1 == number_of_messages: - return { - 'email': 'Send 1 email', - 'sms': 'Send 1 text message' - }[template_type] - else: - return { - 'email': 'Send {} emails', - 'sms': 'Send {} text messages' - }[template_type].format(number_of_messages) - - def get_page_headings(template_type): return { 'email': 'Email templates', @@ -279,7 +266,6 @@ def check_messages(service_id, template_type, upload_id): len(list(recipients.initial_annotated_rows)) ), original_file_name=session['upload_data'].get('original_file_name'), - send_button_text=get_send_button_text(template.template_type, session['upload_data']['notification_count']), upload_id=upload_id, form=CsvUploadForm(), statistics=statistics, diff --git a/app/templates/components/message-count-label.html b/app/templates/components/message-count-label.html index 532a711d5..a4d59afed 100644 --- a/app/templates/components/message-count-label.html +++ b/app/templates/components/message-count-label.html @@ -1,4 +1,4 @@ -{% macro message_count_label(count, template_type) -%} +{% macro message_count_label(count, template_type, suffix='sent') -%} {%- if template_type == 'sms' -%} {%- if count == 1 -%} text message @@ -10,6 +10,6 @@ email {%- else -%} emails - {%- endif -%} - {%- endif %} sent -{%- endmacro %} \ No newline at end of file + {%- endif -%} + {%- endif %} {{ suffix }} +{%- endmacro %} diff --git a/app/templates/views/check.html b/app/templates/views/check.html index e36d913fb..1f95a4d9e 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -7,6 +7,7 @@ {% from "components/file-upload.html" import file_upload %} {% from "components/page-footer.html" import page_footer %} {% from "components/list.html" import formatted_list %} +{% from "components/message-count-label.html" import message_count_label %} {% block page_title %} {{ page_heading if errors else "Check and confirm" }} – GOV.UK Notify @@ -175,7 +176,7 @@ {% endif %}