Show count of cancelled letters on dashboard

This commit is contained in:
Chris Hill-Scott
2018-10-11 11:03:57 +01:00
parent c01d761a3c
commit bbb4b87cac
2 changed files with 21 additions and 5 deletions

View File

@@ -34,7 +34,8 @@
link=None,
show_failures=True,
smaller=False,
smallest=False
smallest=False,
failed_as_cancelled=False
) %}
<div class="big-number-with-status">
{{ big_number(number, label, link=link, smaller=smaller, smallest=smallest) }}
@@ -43,13 +44,27 @@
{% if failures %}
{% if failure_link %}
<a href="{{ failure_link }}">
{{ "{:,}".format(failures) }} failed {{ failure_percentage }}%
{{ "{:,}".format(failures) }}
{% if failed_as_cancelled %}
cancelled
{% else %}
failed {{ failure_percentage }}%
{% endif %}
</a>
{% else %}
{{ "{:,}".format(failures) }} failed {{ failure_percentage }}%
{{ "{:,}".format(failures) }}
{% if failed_as_cancelled %}
cancelled
{% else %}
failed {{ failure_percentage }}%
{% endif %}
{% endif %}
{% else %}
No failures
{% if failed_as_cancelled %}
0 cancelled
{% else %}
No failures
{% endif %}
{% endif %}
</div>
{% endif %}

View File

@@ -37,7 +37,8 @@
statistics['letter']['show_warning'],
failure_link=url_for(".view_notifications", service_id=service_id, message_type='letter', status='failed'),
link=url_for(".view_notifications", service_id=service_id, message_type='letter', status=''),
smaller=smaller_font_size
smaller=smaller_font_size,
failed_as_cancelled=True
) }}
</div>
{% endif %}