Show upcoming jobs on the dashboard

On the dashboard:
- adds a new ‘in the next 24 hours’ section to the dashboard which lists
  upcoming jobs
- tweaks some spacing on the dashboard so that it doesn’t look like too
  much of a mess
- don’t show scheduled jobs in the table of normal jobs

On the jobs page:
- don’t show scheduled jobs
This commit is contained in:
Chris Hill-Scott
2016-08-09 10:39:57 +01:00
parent 3d8d160d3e
commit 4342b721f1
14 changed files with 165 additions and 40 deletions

View File

@@ -1,3 +1,7 @@
{% macro show_more(url, label) %}
<a href="{{ url }}" class="show-more"><span>{{ label }}</span></a>
{% macro show_more(url=None, label=None) %}
{% if url and label %}
<a href="{{ url }}" class="show-more"><span>{{ label }}</span></a>
{% else %}
<span class="show-more-empty"></span>
{% endif %}
{% endmacro %}

View File

@@ -10,7 +10,7 @@
Report is {{ "{:.0f}%".format(percentage_complete) }} complete…
</p>
{% elif notifications %}
<p class="bottom-gutter-1-2">
<p class="bottom-gutter">
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
&emsp;
<span id="time-left">{{ time_left }}</span>

View File

@@ -18,7 +18,11 @@
{% call row_heading() %}
<div class="file-list">
<a class="file-list-filename" href="{{ url_for('.view_job', service_id=current_service.id, job_id=item.id) }}">{{ item.original_file_name }}</a>
<span class="file-list-hint">Uploaded {{ item.created_at|format_datetime_short }}</span>
<span class="file-list-hint">
Sent {{
item.scheduled_for|format_datetime_short if item.scheduled_for else item.created_at|format_datetime_short
}}
</span>
</div>
{% endcall %}
{% call field() %}

View File

@@ -0,0 +1,38 @@
{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading %}
{% from "components/big-number.html" import big_number %}
{% from "components/show-more.html" import show_more %}
{% if scheduled_jobs %}
<div class='dashboard-table'>
<h2 class="heading-medium">
In the next 24 hours
</h2>
{% call(item, row_number) list_table(
scheduled_jobs,
caption="In the next 24 hours",
caption_visible=False,
empty_message='Nothing to see here',
field_headings=[
'File',
'Messages to be sent'
],
field_headings_visible=True
) %}
{% call row_heading() %}
<div class="file-list">
<a class="file-list-filename" href="{{ url_for('.view_job', service_id=current_service.id, job_id=item.id) }}">{{ item.original_file_name }}</a>
<span class="file-list-hint">
Sending at {{ item.scheduled_for|format_time }}
</span>
</div>
{% endcall %}
{% call field() %}
{{ big_number(
item.notification_count,
smallest=True
) }}
{% endcall %}
{% endcall %}
{{ show_more() }}
</div>
{% endif %}

View File

@@ -23,6 +23,8 @@
{% include 'views/dashboard/no-permissions-banner.html' %}
{% endif %}
{{ ajax_block(partials, updates_url, 'upcoming') }}
<h2 class="heading-medium">
In the last 7 days
</h2>

View File

@@ -34,7 +34,7 @@
</div>
{% if notifications %}
<p class="bottom-gutter-1-2">
<p class="bottom-gutter">
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
&emsp;
Data available for 7 days