2020-08-21 11:26:02 +01:00
|
|
|
|
{% from "components/back-link/macro.njk" import govukBackLink %}
|
2020-09-03 10:55:01 +01:00
|
|
|
|
{% from "components/details/macro.njk" import govukDetails %}
|
2020-07-10 14:06:00 +01:00
|
|
|
|
{% from "components/form.html" import form_wrapper %}
|
2020-08-05 16:01:21 +01:00
|
|
|
|
{% from "components/banner.html" import banner %}
|
2020-07-10 14:06:00 +01:00
|
|
|
|
{% from "components/page-header.html" import page_header %}
|
2020-07-17 08:07:44 +01:00
|
|
|
|
{% from "components/page-footer.html" import page_footer %}
|
2020-09-08 16:35:03 +01:00
|
|
|
|
{% from "views/broadcast/macros/area-map.html" import map %}
|
2020-07-10 14:06:00 +01:00
|
|
|
|
|
|
|
|
|
|
{% extends "withnav_template.html" %}
|
|
|
|
|
|
|
2020-09-03 10:55:01 +01:00
|
|
|
|
{% block extra_stylesheets %}
|
|
|
|
|
|
{% include "views/broadcast/partials/area-map-stylesheets.html" %}
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block extra_javascripts %}
|
|
|
|
|
|
{% include "views/broadcast/partials/area-map-javascripts.html" %}
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
2020-07-10 14:06:00 +01:00
|
|
|
|
{% block service_page_title %}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
{% if broadcast_message.status == 'pending-approval' %}
|
2021-06-29 17:34:29 +01:00
|
|
|
|
{% if broadcast_message.created_by and broadcast_message.created_by == current_user
|
2021-07-22 17:12:01 +01:00
|
|
|
|
and current_user.has_permissions('create_broadcasts', 'approve_broadcasts', restrict_admin_usage=True) %}
|
2021-01-15 15:11:43 +00:00
|
|
|
|
{{ broadcast_message.template.name }} is waiting for approval
|
2021-07-22 17:12:01 +01:00
|
|
|
|
{% elif current_user.has_permissions('approve_broadcasts', restrict_admin_usage=True) %}
|
2021-01-27 11:24:22 +00:00
|
|
|
|
{% if broadcast_message.created_by %}
|
|
|
|
|
|
{{ broadcast_message.created_by.name }}
|
|
|
|
|
|
{% else %}
|
|
|
|
|
|
An API call
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
wants to broadcast
|
2021-01-15 15:11:43 +00:00
|
|
|
|
{{ broadcast_message.template.name }}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
{% else %}
|
|
|
|
|
|
This alert is waiting for approval
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
{% else %}
|
2021-01-15 15:11:43 +00:00
|
|
|
|
{{ broadcast_message.template.name }}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
{% endif %}
|
2020-07-10 14:06:00 +01:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
2021-07-30 14:42:54 +01:00
|
|
|
|
{% block backLink %}
|
2020-10-15 13:18:23 +01:00
|
|
|
|
{{ govukBackLink({ "href": back_link }) }}
|
2021-07-30 14:42:54 +01:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block maincolumn_content %}
|
2020-07-10 14:06:00 +01:00
|
|
|
|
|
2020-07-17 08:07:41 +01:00
|
|
|
|
{% if broadcast_message.status == 'pending-approval' %}
|
2021-06-29 17:34:29 +01:00
|
|
|
|
{% if broadcast_message.created_by and broadcast_message.created_by == current_user
|
2021-07-22 17:12:01 +01:00
|
|
|
|
and current_user.has_permissions('create_broadcasts', 'approve_broadcasts', restrict_admin_usage=True) %}
|
2020-08-05 16:01:21 +01:00
|
|
|
|
<div class="banner govuk-!-margin-bottom-6">
|
2020-08-21 11:26:02 +01:00
|
|
|
|
<h1 class="govuk-heading-m govuk-!-margin-bottom-3">
|
2021-01-15 15:11:43 +00:00
|
|
|
|
{{ broadcast_message.template.name }} is waiting for approval
|
2020-08-21 11:26:02 +01:00
|
|
|
|
</h1>
|
|
|
|
|
|
{% if current_service.live %}
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
You need another member of your team to approve your alert.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{{ page_footer(
|
|
|
|
|
|
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
|
2021-07-05 17:10:35 +01:00
|
|
|
|
delete_link_text='Discard this alert'
|
2020-08-21 11:26:02 +01:00
|
|
|
|
) }}
|
2021-07-22 17:12:01 +01:00
|
|
|
|
{% elif current_user.has_permissions('approve_broadcasts', restrict_admin_usage=True) %}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
<p class="govuk-body govuk-!-margin-bottom-3">
|
|
|
|
|
|
When you use a live account you’ll need another member of
|
|
|
|
|
|
your team to approve your alert.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<details class="govuk-details govuk-!-margin-bottom-0" data-module="govuk-details">
|
|
|
|
|
|
<summary class="govuk-details__summary govuk-clearfix">
|
|
|
|
|
|
Approve your own alert
|
|
|
|
|
|
</summary>
|
|
|
|
|
|
{% call form_wrapper() %}
|
|
|
|
|
|
<p class="govuk-body govuk-!-margin-top-2 govuk-!-margin-bottom-3">
|
|
|
|
|
|
Because you’re in training mode you can approve
|
|
|
|
|
|
your own alerts, to see how it works.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p class="govuk-body govuk-!-margin-top-0 govuk-!-margin-bottom-3">
|
|
|
|
|
|
No real alerts will be broadcast to anyone’s phone.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{{ page_footer(
|
|
|
|
|
|
"Start broadcasting now",
|
|
|
|
|
|
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
|
2021-07-05 17:22:35 +01:00
|
|
|
|
delete_link_text='Reject this alert'
|
2020-08-21 11:26:02 +01:00
|
|
|
|
) }}
|
|
|
|
|
|
{% endcall %}
|
|
|
|
|
|
</details>
|
2021-06-29 17:34:29 +01:00
|
|
|
|
{% elif current_user.has_permissions('create_broadcasts', restrict_admin_usage=True) %}
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
You need another member of your team to approve this alert.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
This service is in training mode. No real alerts will be sent.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{{ page_footer(
|
|
|
|
|
|
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
|
|
|
|
|
|
delete_link_text='Discard this alert'
|
|
|
|
|
|
) }}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
{% endif %}
|
2020-08-05 16:01:21 +01:00
|
|
|
|
</div>
|
2021-07-22 17:12:01 +01:00
|
|
|
|
{% elif current_user.has_permissions('approve_broadcasts', restrict_admin_usage=True) %}
|
2020-08-05 16:01:21 +01:00
|
|
|
|
{% call form_wrapper(class="banner govuk-!-margin-bottom-6") %}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
<h1 class="govuk-heading-m govuk-!-margin-top-0 govuk-!-margin-bottom-3">
|
2021-01-27 11:24:22 +00:00
|
|
|
|
{% if broadcast_message.created_by %}
|
|
|
|
|
|
{{ broadcast_message.created_by.name }}
|
|
|
|
|
|
{% else %}
|
|
|
|
|
|
An API call
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
wants to broadcast
|
2021-01-15 15:11:43 +00:00
|
|
|
|
{{ broadcast_message.template.name }}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
</h1>
|
2021-05-12 13:26:13 +01:00
|
|
|
|
{% if current_service.live %}
|
|
|
|
|
|
{{ form.confirm(param_extensions={
|
|
|
|
|
|
'formGroup': {
|
|
|
|
|
|
'classes': 'govuk-!-margin-bottom-4'
|
|
|
|
|
|
}
|
|
|
|
|
|
}) }}
|
|
|
|
|
|
{% else %}
|
|
|
|
|
|
<p class="govuk-body govuk-!-margin-bottom-3">
|
|
|
|
|
|
No phones will get this alert.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{% endif %}
|
2020-08-05 16:01:21 +01:00
|
|
|
|
{{ page_footer(
|
|
|
|
|
|
"Start broadcasting now",
|
|
|
|
|
|
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
|
2020-08-21 11:26:02 +01:00
|
|
|
|
delete_link_text='Reject this alert'
|
2020-08-05 16:01:21 +01:00
|
|
|
|
) }}
|
|
|
|
|
|
{% endcall %}
|
2021-06-29 17:34:29 +01:00
|
|
|
|
{% elif current_user.has_permissions('create_broadcasts', restrict_admin_usage=True) %}
|
|
|
|
|
|
<div class="banner govuk-!-margin-bottom-6">
|
|
|
|
|
|
<h1 class="govuk-heading-m govuk-!-margin-bottom-3">This alert is waiting for approval</h1>
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
Another member of your team needs to approve this alert.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{% if not current_service.live %}
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
This service is in training mode. No real alerts will be sent.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
{{ page_footer(
|
|
|
|
|
|
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
|
|
|
|
|
|
delete_link_text='Reject this alert'
|
|
|
|
|
|
) }}
|
|
|
|
|
|
</div>
|
2020-08-10 12:13:11 +01:00
|
|
|
|
{% else %}
|
|
|
|
|
|
<div class="banner govuk-!-margin-bottom-6">
|
2020-08-21 11:26:02 +01:00
|
|
|
|
<h1 class="govuk-heading-m govuk-!-margin-bottom-3">This alert is waiting for approval</h1>
|
2020-08-10 12:13:11 +01:00
|
|
|
|
<p class="govuk-body">
|
2020-08-21 11:26:02 +01:00
|
|
|
|
You don’t have permission to approve alerts.
|
2020-08-10 12:13:11 +01:00
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
2020-08-05 16:01:21 +01:00
|
|
|
|
{% endif %}
|
2020-07-17 08:07:41 +01:00
|
|
|
|
{% else %}
|
2021-01-15 15:11:43 +00:00
|
|
|
|
{{ page_header(broadcast_message.template.name) }}
|
2020-08-21 11:26:02 +01:00
|
|
|
|
|
2020-10-14 14:05:14 +01:00
|
|
|
|
{% if broadcast_message.status == 'broadcasting' %}
|
2020-10-14 14:11:48 +01:00
|
|
|
|
<p class="govuk-body govuk-!-margin-bottom-2 live-broadcast live-broadcast--left">
|
2020-10-14 14:16:16 +01:00
|
|
|
|
Live since {{ broadcast_message.starts_at|format_datetime_relative }} 
|
2020-07-20 09:27:44 +01:00
|
|
|
|
{%- if not hide_stop_link %}
|
2021-07-05 17:42:37 +01:00
|
|
|
|
<a href="{{ url_for('.cancel_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id) }}" class="destructive-link destructive-link--no-visited-state">Stop sending</a>
|
2020-07-20 09:27:44 +01:00
|
|
|
|
{% endif %}
|
2020-10-14 14:05:14 +01:00
|
|
|
|
</p>
|
2021-04-08 13:34:29 +01:00
|
|
|
|
{% elif broadcast_message.status == 'rejected' %}
|
|
|
|
|
|
<p class="govuk-body govuk-!-margin-bottom-4">
|
|
|
|
|
|
Rejected
|
|
|
|
|
|
{{ broadcast_message.updated_at|format_datetime_human }}.
|
|
|
|
|
|
</p>
|
2020-10-14 14:05:14 +01:00
|
|
|
|
{% else %}
|
|
|
|
|
|
<p class="govuk-body govuk-!-margin-bottom-4">
|
2021-07-05 16:41:17 +01:00
|
|
|
|
Sent
|
2020-10-14 14:05:14 +01:00
|
|
|
|
{{ broadcast_message.starts_at|format_datetime_human }}.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
2020-07-17 08:07:41 +01:00
|
|
|
|
{% endif %}
|
2020-07-10 14:06:00 +01:00
|
|
|
|
|
2020-10-14 13:59:20 +01:00
|
|
|
|
{{ broadcast_message.template|string }}
|
|
|
|
|
|
|
2020-07-10 14:06:00 +01:00
|
|
|
|
{% for area in broadcast_message.areas %}
|
|
|
|
|
|
{% if loop.first %}
|
2020-10-14 13:59:20 +01:00
|
|
|
|
<ul class="area-list">
|
2020-07-10 14:06:00 +01:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
<li class="area-list-item area-list-item--unremoveable">
|
|
|
|
|
|
{{ area.name }}
|
|
|
|
|
|
</li>
|
|
|
|
|
|
{% if loop.last %}
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
2020-10-05 13:47:21 +01:00
|
|
|
|
<div class="area-list-map-details">
|
2020-10-02 14:51:57 +01:00
|
|
|
|
{{ govukDetails({
|
|
|
|
|
|
"summaryText": "Show map of areas",
|
|
|
|
|
|
"html": map(broadcast_message)
|
|
|
|
|
|
}) }}
|
|
|
|
|
|
</div>
|
2020-09-03 10:55:01 +01:00
|
|
|
|
|
2020-10-14 14:00:12 +01:00
|
|
|
|
{% if broadcast_message.status != 'pending-approval' %}
|
|
|
|
|
|
<p class="govuk-body govuk-!-margin-bottom-3">
|
2021-01-27 11:24:22 +00:00
|
|
|
|
{% if broadcast_message.created_by %}
|
2021-07-22 14:27:22 +01:00
|
|
|
|
Created by {{ broadcast_message.created_by.name }}
|
2021-04-08 13:34:29 +01:00
|
|
|
|
{%- else %}
|
2021-01-27 11:24:22 +00:00
|
|
|
|
Created from an API call
|
2021-04-08 13:34:29 +01:00
|
|
|
|
{%- endif %}
|
|
|
|
|
|
{%- if broadcast_message.approved_by %}
|
|
|
|
|
|
and approved by {{ broadcast_message.approved_by.name }}
|
|
|
|
|
|
{%- endif %}
|
|
|
|
|
|
{{- '.' }}
|
2020-10-14 14:00:12 +01:00
|
|
|
|
</p>
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
2020-10-14 14:05:14 +01:00
|
|
|
|
{% if broadcast_message.status == 'broadcasting' %}
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
Broadcasting stops {{ broadcast_message.finishes_at|format_datetime_human }}.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{% elif broadcast_message.status == 'cancelled' %}
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
Stopped by {{ broadcast_message.cancelled_by.name }}
|
|
|
|
|
|
{{ broadcast_message.cancelled_at|format_datetime_human }}.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{% elif broadcast_message.status == 'completed' %}
|
|
|
|
|
|
<p class="govuk-body">
|
|
|
|
|
|
Finished broadcasting {{ broadcast_message.finishes_at|format_datetime_human }}.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
2020-07-10 14:06:00 +01:00
|
|
|
|
{% endblock %}
|