mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Merge pull request #604 from alphagov/improve-job-csv
Improve the ‘download a CSV’ from the job page
This commit is contained in:
@@ -18,7 +18,8 @@ from app import (
|
||||
job_api_client,
|
||||
notification_api_client,
|
||||
service_api_client,
|
||||
current_service)
|
||||
current_service,
|
||||
format_datetime_short)
|
||||
from app.main import main
|
||||
from app.utils import (
|
||||
get_page_from_request,
|
||||
@@ -81,7 +82,10 @@ def view_job(service_id, job_id):
|
||||
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"'
|
||||
'Content-Disposition': 'inline; filename="{} - {}.csv"'.format(
|
||||
template['name'],
|
||||
format_datetime_short(job['created_at'])
|
||||
)
|
||||
}
|
||||
return render_template(
|
||||
'views/jobs/job.html',
|
||||
|
||||
@@ -30,16 +30,14 @@
|
||||
)}}
|
||||
{% 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' %}
|
||||
|
||||
{% include 'partials/jobs/notifications.html' %}
|
||||
|
||||
<p class="table-show-more-link">
|
||||
<a href="{{ request.url }}?&download=csv" download>Download as a CSV file</a>
|
||||
</p>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user