Show message on job page if job is scheduled

If a job is scheduled then we can’t show the notifications yet, and the
progress report will stay at 0%.

In their place we should show what time a job will start.

Later on (when the API is ready) this area of the page should also show
a cancel button.
This commit is contained in:
Chris Hill-Scott
2016-08-25 16:49:31 +01:00
parent 4342b721f1
commit 31a032e678
4 changed files with 103 additions and 56 deletions

View File

@@ -277,7 +277,7 @@ def get_status_filters(service, message_type, statistics):
def _get_job_counts(job, help_argument):
sending = 0 if job['job_status'] == 'pending' else (
sending = 0 if job['job_status'] == 'scheduled' else (
job.get('notification_count', 0) -
job.get('notifications_delivered', 0) -
job.get('notifications_failed', 0)
@@ -324,7 +324,6 @@ def get_job_partials(job):
return {
'counts': render_template(
'partials/jobs/count.html',
job=job,
counts=_get_job_counts(job, request.args.get('help', 0)),
status=filter_args['status']
),
@@ -340,7 +339,8 @@ def get_job_partials(job):
status=request.args.get('status')
),
help=get_help_argument(),
time_left=get_time_left(job['created_at'])
time_left=get_time_left(job['created_at']),
job=job
),
'status': render_template(
'partials/jobs/status.html',