Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1706 updaterevise status banner on confirmation page #2271

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/main/views/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def view_job(service_id, job_id):

filter_args = parse_filter_args(request.args)
filter_args["status"] = set_status_filters(filter_args)

return render_template(
"views/jobs/job.html",
job=job,
Expand Down Expand Up @@ -402,7 +401,7 @@ def get_job_partials(job):
)

if request.referrer is not None:
session["arrived_from_preview_page"] = "check" in request.referrer
session["arrived_from_preview_page"] = ("check" in request.referrer) or ("help=0" in request.referrer)
else:
session["arrived_from_preview_page"] = False

Expand Down
50 changes: 39 additions & 11 deletions app/templates/partials/jobs/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,58 @@ <h2>Delivery Status</h2>

<div class="ajax-block-container">
<p class='bottom-gutter'>
{% if job.still_processing or arrived_from_preview_page_url %}
{% if not job.finished_processing %}
{% if job.scheduled_for %}
<div class="usa-alert usa-alert--info">
<div class="usa-alert__body">
<h2 class="usa-alert__heading">Your text has been scheduled</h2>
<h2 class="usa-alert__heading">Your message has been scheduled</h2>
<p class="usa-alert__text">
{{ job.template_name }} - {{ current_service.name }} was scheduled on {{ job.scheduled_for|format_datetime_normal }} by {{ job.created_by.name }}
</p>
</div>
</div>
{{display_message_status}}
{% else %}
<div class="usa-alert usa-alert--success">
<div class="usa-alert__body">
<h2 class="usa-alert__heading">Your text has been sent</h2>
<p class="usa-alert__text">
{{ job.template_name }} - {{ current_service.name }} was sent on {% if job.processing_started %}
{{ job.processing_started|format_datetime_table }} {% else %}
{{ job.created_at|format_datetime_table }} {% endif %} by {{ job.created_by.name }}
</p>
{% if job.processing_started %}
<div class="usa-alert usa-alert--success">
<div class="usa-alert__body">
<h2 class="usa-alert__heading">
Your message is sending
</h2>
<p class="usa-alert__text">
{{ job.template_name }} - {{ current_service.name }}
has been sending since {{job.processing_started| format_datetime_normal}} by {{ job.created_by.name }}
</p>
</div>
</div>
</div>
{% else %}
<div class="usa-alert usa-alert--info">
<div class="usa-alert__body">
<h2 class="usa-alert__heading">
Your message is pending
</h2>
<p class="usa-alert__text">
{{ job.template_name }} - {{ current_service.name }}
has been pending since {{job.created_at|format_datetime_normal}} by {{ job.created_by.name }}
</p>
</div>
</div>
{% endif %}
{{display_message_status}}
{% endif %}
{% elif arrived_from_preview_page_url %}
<div class="usa-alert usa-alert--success">
<div class="usa-alert__body">
<h2 class="usa-alert__heading">
Your message has been sent
</h2>
<p class="usa-alert__text">
{{ job.template_name }} - {{ current_service.name }}
was sent on {{job.processing_started|format_datetime_normal}} by {{ job.created_by.name }}
</p>
</div>
</div>
{{display_message_status}}
{% endif %}
</p>
{% if job.status == 'sending limits exceeded'%}
Expand Down
13 changes: 12 additions & 1 deletion app/templates/views/jobs/job.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@
{% block maincolumn_content %}

{{ page_header("Message status") }}
{{ partials['status']|safe }}
{% if not job.processing_finished %}
<div
data-module="update-content"
data-resource="{{ updates_url }}"
data-key="status"
data-form=""
>
{% endif %}
{{ partials['status']|safe }}
{% if not job.processing_finished %}
</div>
{% endif %}
{% if not finished %}
<div
data-module="update-content"
Expand Down
Loading