mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-02 15:11:13 -04:00
Download csv for job added.
Removed check for notifications so download button is always there.
This commit is contained in:
@@ -76,6 +76,13 @@ def view_job(service_id, job_id):
|
||||
version=job['template_version'])['data']
|
||||
notifications = notification_api_client.get_notifications_for_service(service_id, job_id)
|
||||
finished = job['status'] == 'finished'
|
||||
if 'download' in request.args and request.args['download'] == 'csv':
|
||||
csv_content = generate_notifications_csv(
|
||||
notification_api_client.get_notifications_for_service(service_id, job_id)['notifications'])
|
||||
return csv_content, 200, {
|
||||
'Content-Type': 'text/csv; charset=utf-8',
|
||||
'Content-Disposition': 'inline; filename="job_notifications.csv"'
|
||||
}
|
||||
return render_template(
|
||||
'views/jobs/job.html',
|
||||
notifications=notifications['notifications'],
|
||||
|
||||
@@ -30,6 +30,12 @@
|
||||
)}}
|
||||
{% endif %}
|
||||
|
||||
<p class="bottom-gutter">
|
||||
<a href="{{ request.url }}?&download=csv" download class="heading-small">Download as a CSV file</a>
|
||||
 
|
||||
Delivery information is available for 7 days
|
||||
</p>
|
||||
|
||||
{% include 'partials/jobs/status.html' %}
|
||||
|
||||
{% include 'partials/jobs/count.html' %}
|
||||
|
||||
Reference in New Issue
Block a user