mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 17:18:24 -04:00
This commit extends the `ajax_block` component to take a `dict` of partials, from which it can select the partial matching its `key` argument and print its HTML to the page. This means that the same markup is only rendered in one place, rather than in two (individually in the JSON endpoint and as `include`s in the parent template).
37 lines
1.1 KiB
HTML
37 lines
1.1 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/banner.html" import banner %}
|
||
{% from "components/sms-message.html" import sms_message %}
|
||
{% from "components/email-message.html" import email_message %}
|
||
{% from "components/ajax-block.html" import ajax_block %}
|
||
|
||
{% block page_title %}
|
||
{{ uploaded_file_name }} – GOV.UK Notify
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
<h1 class="heading-large">
|
||
{{ uploaded_file_name }}
|
||
</h1>
|
||
|
||
{% if 'sms' == template.template_type %}
|
||
<div class="grid-row">
|
||
<div class="column-two-thirds">
|
||
{{ sms_message(
|
||
template.formatted_as_markup,
|
||
)}}
|
||
</div>
|
||
</div>
|
||
{% elif 'email' == template.template_type %}
|
||
{{ email_message(
|
||
template.formatted_subject_as_markup,
|
||
template.formatted_as_markup
|
||
)}}
|
||
{% endif %}
|
||
|
||
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
|
||
{{ ajax_block(partials, updates_url, 'counts', finished=finished) }}
|
||
{{ ajax_block(partials, updates_url, 'notifications', finished=finished) }}
|
||
|
||
{% endblock %}
|