mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -04:00
Use message_count_label component
For the button on the check page, we need to be able to say ‘1 text message’ or ‘55 emails’. We already have the logic to do this on the dashboard (101 text messages sent), and it’s already in a component. So this commit makes the check page use the same component.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user