diff --git a/app/assets/sass/uswds/_legacy-styles.scss b/app/assets/sass/uswds/_legacy-styles.scss index b96a24844..0f16e8861 100644 --- a/app/assets/sass/uswds/_legacy-styles.scss +++ b/app/assets/sass/uswds/_legacy-styles.scss @@ -62,6 +62,14 @@ margin: -20px units(1) 20px units(1); } +h2.sms-message-header { + margin-bottom: 0.5rem; +} + +h2.recipient-list { + margin-bottom: 0.5rem; +} + .sms-message-status-outbound { text-align: right; } diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index a728229d3..0c0848e46 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -10,6 +10,7 @@ from flask import ( redirect, render_template, request, + session, stream_with_context, url_for, ) @@ -373,6 +374,13 @@ def get_job_partials(job): job.template_type ) + if request.referrer is not None: + session["arrived_from_preview_page"] = "check" in request.referrer + else: + session["arrived_from_preview_page"] = False + + arrived_from_preview_page_url = session.get("arrived_from_preview_page", False) + return { "counts": counts, "notifications": render_template( @@ -396,6 +404,7 @@ def get_job_partials(job): "status": render_template( "partials/jobs/status.html", job=job, + arrived_from_preview_page_url=arrived_from_preview_page_url, ), } diff --git a/app/main/views/send.py b/app/main/views/send.py index 8853b7fc3..3aa5bd830 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -1012,8 +1012,9 @@ def send_notification(service_id, template_id): return redirect( url_for( - ".view_notification", + ".view_job", service_id=service_id, + job_id=upload_id, from_job=upload_id, notification_id=notifications["notifications"][0]["id"], # used to show the final step of the tour (help=3) or not show diff --git a/app/templates/partials/jobs/status.html b/app/templates/partials/jobs/status.html index 7c73be426..99b5768e8 100644 --- a/app/templates/partials/jobs/status.html +++ b/app/templates/partials/jobs/status.html @@ -1,13 +1,48 @@ +{% set display_message_status %} +{% if job.template.content %} +

Message

+
{{ current_service.name }}: {{job.template.content}}
+{% endif %} +{% if job.original_file_name %} +

Recipient list

+
+ +
+{% endif %} +

Delivery Status

+{% endset %} +

- {% if job.scheduled_for %} - {% if job.processing_started %} - Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_normal }} + {% if job.still_processing or arrived_from_preview_page_url %} + {% if job.scheduled_for %} +

+
+

Your text has been scheduled

+

+ {{ job.template_name }} - {{ current_service.name }} was scheduled on {{ job.scheduled_for|format_datetime_normal }} by {{ job.created_by.name }} +

+
+
+ {{display_message_status}} {% else %} - Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_normal }} +
+
+

Your text has been sent

+

+ {{ job.template_name }} - {{ current_service.name }} was sent on {{ job.created_at|format_datetime_normal }} by {{ job.created_by.name }} +

+
+
+ {{display_message_status}} {% endif %} - {% else %} - Sent by {{ job.created_by.name }} on {{ job.created_at|format_datetime_normal }} {% endif %}

{% if job.status == 'sending limits exceeded'%} diff --git a/app/templates/views/jobs/job.html b/app/templates/views/jobs/job.html index 0c334a634..ce4e94b3d 100644 --- a/app/templates/views/jobs/job.html +++ b/app/templates/views/jobs/job.html @@ -5,26 +5,13 @@ {% from "components/components/back-link/macro.njk" import usaBackLink %} {% block service_page_title %} - {{ job.original_file_name }} + {{ "Message status" }} {% endblock %} {% block maincolumn_content %} - {{ page_header(job.original_file_name) }} - - {% if not job.processing_finished %} -
- {% endif %} - {{ partials['status']|safe }} - {% if not job.processing_finished %} -
- {% endif %} - + {{ page_header("Message status") }} + {{ partials['status']|safe }} {% if not finished %}