Don’t show status for individual letters

The status won’t ever change from sending for letters. For now at least.
And even when we do come up with more useful statuses I’m not convinced
it’s useful to expose them to our admin users.

A more useful piece of information to show is when we think the letter
will be delivered.
This commit is contained in:
Chris Hill-Scott
2017-07-13 13:05:41 +01:00
parent b003162932
commit 63e9ef44e7
5 changed files with 45 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ from app.utils import (
get_help_argument,
get_template,
get_time_left,
get_letter_timings,
REQUESTED_STATUSES,
FAILURE_STATUSES,
SENDING_STATUSES,
@@ -63,6 +64,7 @@ def view_notification(service_id, notification_id):
job = job_api_client.get_job(service_id, notification['job']['id'])['data']
else:
job = None
return render_template(
'views/notifications/notification.html',
finished=(notification['status'] in (DELIVERED_STATUSES + FAILURE_STATUSES)),
@@ -79,7 +81,8 @@ def view_notification(service_id, notification_id):
partials=get_single_notification_partials(notification),
created_by=notification.get('created_by'),
created_at=notification['created_at'],
help=get_help_argument()
help=get_help_argument(),
estimated_letter_delivery_date=get_letter_timings(notification['created_at']).earliest_delivery,
)

View File

@@ -30,8 +30,16 @@
on {{ created_at|format_datetime_short }}
</p>
{% if template.template_type == 'letter' %}
<p>
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
</p>
{% endif %}
{{ template|string }}
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
{% if template.template_type != 'letter' %}
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
{% endif %}
{% endblock %}