Split the JSON responses into one key per section

Previously, the AJAX update for the dashboard was returning a big blob
of JSON with one key.

This commit splits it up to return:

- one key for each section of the page
- each containing a smaller chunk of HTML rendered from a partial

The jobs page was already working this way (pretty much) but just needed
a little tweaking to get it the same.
This commit is contained in:
Chris Hill-Scott
2016-06-28 11:55:00 +01:00
parent fe1d63675d
commit c761d57d1d
9 changed files with 135 additions and 131 deletions
+1 -13
View File
@@ -1,17 +1,6 @@
{% from "components/table.html" import list_table, field, right_aligned_field_heading, date_field, row_heading %}
<div
{% if notifications %}
class='dashboard-table'
{% endif %}
{% if not finished %}
data-module="update-content"
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id, status=request.args.get('status'), help=request.args.get('help'))}}"
data-key="notifications"
aria-live="polite"
{% endif %}
>
<div class="dashboard-table">
{% if notifications %}
<p class="bottom-gutter">
<a href="{{ url_for('.view_job_csv', service_id=current_service.id, job_id=job.id, status=status) }}" download="download" class="heading-small">Download as a CSV file</a>
@@ -45,5 +34,4 @@
{{ item.status|format_notification_status(item.template.template_type) }}
{% endcall %}
{% endcall %}
</div>