Don’t show blue boxes once notifications have gone

You can click the blue boxes to filter the list of notifications. Once
the notifications have gone there’s nothing to filter, so we should just
show the numbers but without them being clickable.
This commit is contained in:
Chris Hill-Scott
2019-12-30 16:53:45 +00:00
parent 9446b35e3b
commit 93d2d47f4e
3 changed files with 32 additions and 3 deletions

View File

@@ -446,7 +446,10 @@ def get_job_partials(job, template):
counts = render_template(
'partials/count.html',
counts=_get_job_counts(job),
status=filter_args['status']
status=filter_args['status'],
notifications_deleted=(
job['job_status'] == 'finished' and not notifications['notifications']
),
)
service_data_retention_days = current_service.get_days_of_retention(template['template_type'])
can_letter_job_be_cancelled = False

View File

@@ -1,5 +1,18 @@
{% from "components/big-number.html" import big_number %}
{% from "components/pill.html" import pill %}
<div class="bottom-gutter ajax-block-container">
{{ pill(counts, request.args.get('status', '')) }}
<div class="ajax-block-container">
{% if notifications_deleted %}
<div class="grid-row bottom-gutter-1-2">
{% for label, query_param, url, count in counts %}
<div class="column-one-quarter">
{{ big_number(count, label, smaller=True) }}
</div>
{% endfor %}
</div>
{% else %}
<div class="bottom-gutter">
{{ pill(counts, request.args.get('status', '')) }}
</div>
{% endif %}
</div>