created an alert for confirmation during send flow

This commit is contained in:
Beverly Nguyen
2024-02-13 17:48:06 -08:00
parent c74575a0b8
commit c2d7828138
6 changed files with 62 additions and 23 deletions

View File

@@ -53,6 +53,7 @@ from app.formatters import (
format_datetime_normal,
format_datetime_relative,
format_datetime_short,
format_datetime_short_12h,
format_datetime_short_america,
format_day_of_week,
format_delta,
@@ -549,6 +550,7 @@ def add_template_filters(application):
format_datetime_24h,
format_datetime_normal,
format_datetime_short,
format_datetime_short_12h,
format_datetime_short_america,
valid_phone_number,
linkable_name,

View File

@@ -98,6 +98,12 @@ def format_datetime_short(date):
)
def format_datetime_short_12h(date):
return "{} at {} {}".format(
format_date_short(date), format_time_12h(date), get_user_preferred_timezone()
)
def format_datetime_short_america(date):
return "{} at {}".format(format_date_numeric_america(date), format_time_12h(date))

View File

@@ -2,12 +2,33 @@
<p class='bottom-gutter'>
{% if job.scheduled_for %}
{% if job.processing_started %}
Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_short }}
<div class="usa-alert usa-alert--success">
<div class="usa-alert__body">
<h4 class="usa-alert__heading">{{ job.template_name }} - {{ current_service.name }}</h4>
<p class="usa-alert__text">
Was sent on {{ job.created_at|format_datetime_short_12h }} by {{ job.created_by.name }}
</p>
</div>
</div>
{% else %}
Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
<div class="usa-alert usa-alert--info">
<div class="usa-alert__body">
<h4 class="usa-alert__heading">{{ job.template_name }} - {{ current_service.name }}</h4>
<p class="usa-alert__text">
Was scheduled on {{ job.scheduled_for|format_datetime_short_12h }} by {{ job.created_by.name }}
</p>
</div>
</div>
{% endif %}
{% else %}
Sent by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
<div class="usa-alert usa-alert--success">
<div class="usa-alert__body">
<h4 class="usa-alert__heading">{{ job.template_name }} - {{ current_service.name }}</h4>
<p class="usa-alert__text">
Was sent on {{ job.created_at|format_datetime_short_12h }} by {{ job.created_by.name }}
</p>
</div>
</div>
{% endif %}
</p>
{% if job.status == 'sending limits exceeded'%}

View File

@@ -24,18 +24,16 @@
{% if help %}
{{ template.name }}
{% else %}
<a class="usa-link" href="{{ url_for('.view_template', service_id=current_service.id, template_id=template.id) }}">{{ template.name }}</a>
<!-- <a class="usa-link" href="{{ url_for('.view_template', service_id=current_service.id, template_id=template.id) }}">{{ template.name }}</a> -->
{% endif %}
was sent
{% if job and job.original_file_name != 'Report' %}
{% set destination =
{'email': 'an email address', 'sms': 'a phone number'} %}
to {{ destination[template.template_type] }} from
<a class="usa-link" href="{{ url_for('.view_job', service_id=current_service.id, job_id=job.id) }}">{{ job.original_file_name }}</a>
{% elif created_by %}
by {{ created_by.name }}
{% endif %}
{{ created_at|format_datetime_human }}
<div class="usa-alert usa-alert--success">
<div class="usa-alert__body">
<h4 class="usa-alert__heading">{{ template.name }} - {{ current_service.name }}</h4>
<p class="usa-alert__text">
Was sent on {{ created_at|format_datetime_short_12h }} by {{ created_by.name }}
</p>
</div>
</div>
</p>
<div class="">