mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Display broadcasts without a template
At the moment the admin app expects all broadcasts to have a template, and expects the content of the alert to come from the template. This commit makes it so those pages can still get a `Template` instance, but populated with content straight from the `content` field in the database.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<div class="keyline-block">
|
||||
<div class="file-list govuk-!-margin-bottom-2">
|
||||
<h2>
|
||||
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for(view_broadcast_endpoint, service_id=current_service.id, broadcast_message_id=item.id) }}">{{ item.template_name }}</a>
|
||||
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for(view_broadcast_endpoint, service_id=current_service.id, broadcast_message_id=item.id) }}">{{ item.template.name }}</a>
|
||||
</h2>
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-one-half">
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
{{ page_header(
|
||||
"Choose where to broadcast to",
|
||||
back_link=url_for('.view_template', service_id=current_service.id, template_id=broadcast_message.template_id)
|
||||
back_link=back_link
|
||||
) }}
|
||||
|
||||
{% for area in broadcast_message.areas %}
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
{% block service_page_title %}
|
||||
{% if broadcast_message.status == 'pending-approval' %}
|
||||
{% if broadcast_message.created_by == current_user and current_user.has_permissions('send_messages') %}
|
||||
{{ broadcast_message.template_name }} is waiting for approval
|
||||
{{ broadcast_message.template.name }} is waiting for approval
|
||||
{% elif current_user.has_permissions('send_messages') %}
|
||||
{{ broadcast_message.created_by.name }} wants to broadcast
|
||||
{{ broadcast_message.template_name }}
|
||||
{{ broadcast_message.template.name }}
|
||||
{% else %}
|
||||
This alert is waiting for approval
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ broadcast_message.template_name }}
|
||||
{{ broadcast_message.template.name }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
{% if broadcast_message.created_by == current_user and current_user.has_permissions('send_messages') %}
|
||||
<div class="banner govuk-!-margin-bottom-6">
|
||||
<h1 class="govuk-heading-m govuk-!-margin-bottom-3">
|
||||
{{ broadcast_message.template_name }} is waiting for approval
|
||||
{{ broadcast_message.template.name }} is waiting for approval
|
||||
</h1>
|
||||
{% if current_service.live %}
|
||||
<p class="govuk-body">
|
||||
@@ -80,7 +80,7 @@
|
||||
{% call form_wrapper(class="banner govuk-!-margin-bottom-6") %}
|
||||
<h1 class="govuk-heading-m govuk-!-margin-top-0 govuk-!-margin-bottom-3">
|
||||
{{ broadcast_message.created_by.name }} wants to broadcast
|
||||
{{ broadcast_message.template_name }}
|
||||
{{ broadcast_message.template.name }}
|
||||
</h1>
|
||||
{{ page_footer(
|
||||
"Start broadcasting now",
|
||||
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ page_header(broadcast_message.template_name) }}
|
||||
{{ page_header(broadcast_message.template.name) }}
|
||||
|
||||
{% if broadcast_message.status == 'broadcasting' %}
|
||||
<p class="govuk-body govuk-!-margin-bottom-2 live-broadcast live-broadcast--left">
|
||||
|
||||
Reference in New Issue
Block a user