mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Make a macro for the AJAX update module
This is less repetitive than typing out the HTML with all its attributes every time. It also lets us wrap up the idea of ‘finished’ as a parameter, so the AJAX code will only be initiated when it’s needed, eg if a job is still processing.
This commit is contained in:
@@ -49,6 +49,7 @@ def service_dashboard(service_id):
|
||||
return render_template(
|
||||
'views/dashboard/dashboard.html',
|
||||
templates=service_api_client.get_service_templates(service_id)['data'],
|
||||
updates_url=url_for(".service_dashboard_updates", service_id=service_id),
|
||||
**get_dashboard_statistics_for_service(service_id)
|
||||
)
|
||||
|
||||
|
||||
@@ -97,7 +97,13 @@ def view_job(service_id, job_id):
|
||||
prefix=current_service['name']
|
||||
),
|
||||
counts=_get_job_counts(job, request.args.get('help', 0)),
|
||||
status=request.args.get('status', '')
|
||||
status=request.args.get('status', ''),
|
||||
updates_url=url_for(
|
||||
".view_job_updates",
|
||||
service_id=service_id,
|
||||
job_id=job['id'],
|
||||
status=request.args.get('status', '')
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user