Make data consistent from dashboard -> job

- adds a table of recent activity to the job page, which is shared by the
  dashboard page
- uses the same filename and message template as the first job shown on the
  dashboard
- sets the time of file uploads/message delivery/message sending to always
  match ‘just now’
This commit is contained in:
Chris Hill-Scott
2015-12-18 10:26:56 +00:00
parent 0e6dab3f5c
commit 31e6e53d46
10 changed files with 152 additions and 82 deletions

View File

@@ -1,55 +1,35 @@
{% extends "withnav_template.html" %}
{% from "components/table.html" import table, field %}
{% block page_title %}
GOV.UK Notify | Dashboard
GOV.UK Notify | Dashboard
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-xlarge">Dashboard</h1>
<h1 class="heading-xlarge">Dashboard</h1>
<table>
<thead>
<tr>
<th colspan="4">Recent activity</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href={{ url_for('.showjob') }}>Test message 1</a></td>
<td>dispatch_20151114.csv</td>
<td>Just now</td>
<td>Queued</td>
</tr>
<tr>
<td><a href={{ url_for('.showjob') }}>Mickey Mouse</a></td>
<td>dispatch_20151117.csv</td>
<td>5 minutes ago</td>
<td>Delivered</td>
</tr>
<tr>
<td><a href={{ url_for('.showjob') }}>Asdfgg</a></td>
<td>remdinder_monday.csv</td>
<td>30 minutes ago</td>
<td>Failed</td>
</tr>
<tr>
<td><a href={{ url_for('.showjob') }}>Test message 2</a></td>
<td>appointments_wed.csv</td>
<td>2 hours ago</td>
<td>Delivered</td>
</tr>
<tr>
<td><a href={{ url_for('.showjob') }}>Reminder file</a></td>
<td>+447889887634</td>
<td>11:44 - 21 Nov 2015</td>
<td>Delivered</td>
</tr>
</tbody>
</table>
<br/>
<p><a href={{ url_for('.showjobs') }}>See all notifications activity</a></p>
{% call(item) table(
jobs[:3],
caption="Recent activity",
field_headings=['Job', 'File', 'Time', 'Status']
) %}
{% call field() %}
<a href="{{ url_for('.showjob') }}">{{ item.file }}</a>
{% endcall %}
{% call field() %}
<a href="{{ url_for('.showjob') }}">{{ item.job }}</a>
{% endcall %}
{% call field() %}
{{ item.time }}
{% endcall %}
{% call field() %}
{{ item.status }}
{% endcall %}
{% endcall %}
<p>
<a href={{ url_for('.showjobs') }}>See all notifications activity</a>
</p>
{% endblock %}

View File

@@ -10,7 +10,7 @@ GOV.UK Notify | Notifications activity
{% block maincolumn_content %}
<h1 class="heading-large">
{{ uploaded_file_name }} sent with {{ template_used }}
{{ uploaded_file_name }}
</h1>
{{ banner(flash_message) }}
@@ -36,7 +36,7 @@ GOV.UK Notify | Notifications activity
</ul>
<p>
You uploaded contact-demo.csv today at 13:42
Sent with template <a href="{{ url_for('.edittemplate') }}">{{ template_used }}</a> at {{ uploaded_file_time }}
</p>
{% call(item) table(

View File

@@ -1,4 +1,5 @@
{% extends "withnav_template.html" %}
{% from "components/table.html" import table, field %}
{% block page_title %}
GOV.UK Notify | Notifications activity
@@ -8,11 +9,25 @@ GOV.UK Notify | Notifications activity
<h1 class="heading-xlarge">Notifications activity</h1>
<p>This page will be where we show the list of jobs that this service has processed</p>
<p>
<a href="jobs/job">view a particular notification job</a>
</p>
{% call(item) table(
jobs,
caption="Recent activity",
caption_visible=False,
field_headings=['Job', 'File', 'Time', 'Status']
) %}
{% call field() %}
<a href="{{ url_for('.showjob') }}">{{ item.file }}</a>
{% endcall %}
{% call field() %}
<a href="{{ url_for('.showjob') }}">{{ item.job }}</a>
{% endcall %}
{% call field() %}
{{ item.time }}
{% endcall %}
{% call field() %}
{{ item.status }}
{% endcall %}
{% endcall %}
{% endblock %}