Skip to content

Commit

Permalink
update banner with different status states
Browse files Browse the repository at this point in the history
  • Loading branch information
Beverly Nguyen authored and Beverly Nguyen committed Jan 16, 2025
1 parent 9293586 commit ae083f4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/main/views/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ def get_job_partials(job):
session["arrived_from_preview_page"] = False

arrived_from_preview_page_url = session.get("arrived_from_preview_page", False)
print('job', dir(job))

return {
"counts": counts,
Expand Down
43 changes: 33 additions & 10 deletions app/templates/partials/jobs/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <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 or arrived_from_preview_page_url %}
{% if job.scheduled_for %}
<div class="usa-alert usa-alert--info">
<div class="usa-alert__body">
Expand All @@ -33,16 +33,39 @@ <h2 class="usa-alert__heading">Your text has been scheduled</h2>
</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.finished_processing or job.processing_started %}
<div class="usa-alert usa-alert--success">
<div class="usa-alert__body">
<h2 class="usa-alert__heading">
{% if job.finished_processing %}
Your text has been sent
{% else %}
Your text is sending
{% endif %}
</h2>
<p class="usa-alert__text">
{{ job.template_name }} - {{ current_service.name }}
{% if job.finished_processing %}
was sent on {{job.processing_started|format_datetime_normal}}
{% else %}
has been sending since {{job.processing_started| format_datetime_normal}}
{% endif %} 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 text 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 %}
{% endif %}
Expand Down

0 comments on commit ae083f4

Please sign in to comment.