mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 18:38:24 -04:00
This is a first go at having the job page update without refreshing. The approach I’ve taken is to do all the rendering of HTML on the server side, rather than use a Javascipt templating engine like mustache. This ensures that we don’t have to maintain two sets of templates. So the approach is to split the job page into partials. These partials can then: - be included in the job page to render the whole page - be rendered indivudually and then returned as a blob of HTML inside a JSON response Then I’ve added a Javascript module which looks for areas of the page that should be reloaded. For each area of the page it will poll a URL and re-render that section of the page when it gets new HTML. It implements some throttling so that API calls will never happen more frequently than 0.67 times/second.
32 lines
928 B
HTML
32 lines
928 B
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/table.html" import list_table, field, right_aligned_field_heading %}
|
||
|
||
{% block page_title %}
|
||
Notifications activity – GOV.UK Notify
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
<h1 class="heading-large">Notifications activity</h1>
|
||
|
||
{% call(item) list_table(
|
||
jobs,
|
||
caption="Recent activity",
|
||
caption_visible=False,
|
||
empty_message='You haven’t sent any notifications yet',
|
||
field_headings=['Job', 'Time', right_aligned_field_heading('Status')]
|
||
) %}
|
||
{% call field() %}
|
||
<a href="{{ url_for('.view_job', service_id=service_id, job_id=item.id) }}">{{ item.original_file_name }}</a>
|
||
{% endcall %}
|
||
{% call field() %}
|
||
{{ item.created_at | format_datetime}}
|
||
{% endcall %}
|
||
{% call field(align='right') %}
|
||
{{ item.status }}
|
||
{% endcall %}
|
||
{% endcall %}
|
||
|
||
|
||
{% endblock %}
|