Put uploaded files on the dashboard

This commit depends on and uses the data returned by:
- [x] https://github.com/alphagov/notifications-api/pull/345
- [x] https://github.com/alphagov/notifications-api/pull/347
- [x] https://github.com/alphagov/notifications-admin/pull/612

It puts the last 5 jobs on the dashboard. This should be changed to all the jobs
from the last 7 days when that parameter is available.

It also:
- links to the jobs page
- makes the numbers on the jobs page consistent with the dashboard
- makes the numbers on an individual job consistent with the appearance of the
  dashboard
This commit is contained in:
Chris Hill-Scott
2016-05-25 13:36:35 +01:00
parent fe38a46798
commit 16d83faa72
14 changed files with 130 additions and 107 deletions

View File

@@ -1,9 +1,9 @@
{% from "components/big-number.html" import big_number %}
<div
{% if not finished_at %}
{% if not finished %}
data-module="update-content"
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job_id)}}"
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id)}}"
data-key="counts"
aria-live="polite"
{% endif %}
@@ -12,12 +12,17 @@
<ul class="grid-row job-totals">
<li class="column-one-quarter">
{{ big_number(
counts.queued, 'queued'
job.get('notifications_sent', 0) - job.get('notifications_delivered', 0) - job.get('notifications_failed', 0), 'sending'
)}}
</li>
<li class="column-one-quarter">
{{ big_number(
counts.sent, 'processed'
job.get('notifications_delivered', 0), 'delivered'
)}}
</li>
<li class="column-one-quarter">
{{ big_number(
job.notifications_failed, 'failed'
)}}
</li>
</ul>

View File

@@ -1,9 +1,9 @@
{% from "components/table.html" import list_table, field, right_aligned_field_heading %}
<div
{% if not finished_at %}
{% if not finished %}
data-module="update-content"
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job_id)}}"
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id)}}"
data-key="notifications"
aria-live="polite"
{% endif %}

View File

@@ -1,12 +1,12 @@
<div
{% if not finished_at %}
{% if not finished %}
data-module="update-content"
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job_id)}}"
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id)}}"
data-key="status"
aria-live="polite"
{% endif %}
>
<p class='heading-small'>
Sent by {{ created_by }} on {{ uploaded_at|format_datetime_short }}
Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
</p>
</div>