mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 16:19:49 -04:00
add add one-off notification status
completely mimicks the job status page, and as such, all the code and templates have been taken from the job page. This page performs exactly the same as the job page for now * total, sending, delivered, failed blue boxes (though they'll just read 0/1 for now. * download report button (same as with job download, except without job or row number in file) * removed references to scheduled * kept references to help (aka tour/tutorial) as that'll eventually change over from a job to a one-off too
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import ago
|
||||
import dateutil
|
||||
from orderedset import OrderedSet
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from itertools import chain
|
||||
|
||||
from flask import (
|
||||
@@ -35,6 +32,7 @@ from app.utils import (
|
||||
generate_notifications_csv,
|
||||
get_help_argument,
|
||||
get_template,
|
||||
get_time_left,
|
||||
REQUESTED_STATUSES,
|
||||
FAILURE_STATUSES,
|
||||
SENDING_STATUSES,
|
||||
@@ -364,7 +362,7 @@ def get_job_partials(job):
|
||||
)
|
||||
return {
|
||||
'counts': render_template(
|
||||
'partials/jobs/count.html',
|
||||
'partials/count.html',
|
||||
counts=_get_job_counts(job, request.args.get('help', 0)),
|
||||
status=filter_args['status']
|
||||
),
|
||||
@@ -388,16 +386,3 @@ def get_job_partials(job):
|
||||
job=job
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def get_time_left(job_created_at):
|
||||
return ago.human(
|
||||
(
|
||||
datetime.now(timezone.utc).replace(hour=23, minute=59, second=59)
|
||||
) - (
|
||||
dateutil.parser.parse(job_created_at) + timedelta(days=8)
|
||||
),
|
||||
future_tense='Data available for {}',
|
||||
past_tense='Data no longer available', # No-one should ever see this
|
||||
precision=1
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user