Merge pull request #3952 from alphagov/emergency-alerts-content-review

Emergency alerts content review
This commit is contained in:
Chris Hill-Scott
2021-07-08 09:33:54 +01:00
committed by GitHub
15 changed files with 43 additions and 43 deletions
+3 -3
View File
@@ -64,7 +64,7 @@ def broadcast_dashboard(service_id):
)
@main.route('/services/<uuid:service_id>/previous-alerts')
@main.route('/services/<uuid:service_id>/past-alerts')
@user_has_permissions()
@service_has_permission('broadcast')
def broadcast_dashboard_previous(service_id):
@@ -74,8 +74,8 @@ def broadcast_dashboard_previous(service_id):
'cancelled',
'completed',
),
page_title='Previous alerts',
empty_message='You do not have any previous alerts',
page_title='Past alerts',
empty_message='You do not have any past alerts',
view_broadcast_endpoint='.view_previous_broadcast',
)
+1 -1
View File
@@ -6,7 +6,7 @@
{% if current_user.has_permissions() %}
{% if current_service.has_permission('broadcast') %}
<li><a class="govuk-link govuk-link--no-visited-state{{ main_navigation.is_selected('current-broadcasts') }}" href="{{ url_for('.broadcast_dashboard', service_id=current_service.id) }}">Current alerts</a></li>
<li><a class="govuk-link govuk-link--no-visited-state{{ main_navigation.is_selected('previous-broadcasts') }}" href="{{ url_for('.broadcast_dashboard_previous', service_id=current_service.id) }}">Previous alerts</a></li>
<li><a class="govuk-link govuk-link--no-visited-state{{ main_navigation.is_selected('previous-broadcasts') }}" href="{{ url_for('.broadcast_dashboard_previous', service_id=current_service.id) }}">Past alerts</a></li>
<li><a class="govuk-link govuk-link--no-visited-state{{ main_navigation.is_selected('rejected-broadcasts') }}" href="{{ url_for('.broadcast_dashboard_rejected', service_id=current_service.id) }}">Rejected alerts</a></li>
{% elif current_user.has_permissions('view_activity') %}
<li><a class="govuk-link govuk-link--no-visited-state{{ main_navigation.is_selected('dashboard') }}" href="{{ url_for('.service_dashboard', service_id=current_service.id) }}">Dashboard</a></li>
+1 -1
View File
@@ -26,7 +26,7 @@
{% call form_wrapper() %}
{{ form.areas }}
{{ sticky_page_footer('Add to broadcast') }}
{{ sticky_page_footer('Continue') }}
{% endcall %}
{% endblock %}
+1 -1
View File
@@ -35,7 +35,7 @@
</div>
{% endfor %}
{{ sticky_page_footer('Add to broadcast') }}
{{ sticky_page_footer('Continue') }}
{% endcall %}
+2 -2
View File
@@ -3,13 +3,13 @@
{% extends "withnav_template.html" %}
{% block service_page_title %}
Choose where to broadcast to
Choose where to send this alert
{% endblock %}
{% block maincolumn_content %}
{{ page_header(
"Choose where to broadcast to",
"Choose where to send this alert",
back_link=url_for(".preview_broadcast_areas", service_id=current_service.id, broadcast_message_id=broadcast_message.id)
) }}
@@ -6,7 +6,7 @@
{% extends "withnav_template.html" %}
{% block service_page_title %}
Choose where to broadcast to
Choose where to send this alert
{% endblock %}
{% block extra_stylesheets %}
@@ -20,7 +20,7 @@
{% block maincolumn_content %}
{{ page_header(
"Choose where to broadcast to",
"Choose where to send this alert",
back_link=back_link
) }}
@@ -54,7 +54,7 @@
{% if broadcast_message.areas %}
{{ map(broadcast_message) }}
<form action="{{ url_for('.preview_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id) }}" method="get" class="govuk-!-margin-top-1">
{{ page_footer('Continue to preview') }}
{{ page_footer('Preview this alert') }}
</form>
{% endif %}
+1 -1
View File
@@ -28,7 +28,7 @@
{{ form.areas }}
</div>
{{ sticky_page_footer('Add to broadcast') }}
{{ sticky_page_footer('Continue') }}
{% endcall %}
+2 -2
View File
@@ -3,7 +3,7 @@
{% extends "admin_template.html" %}
{% block per_page_title %}
In an emergency, you can broadcast an alert to every mobile phone in
In an emergency, you can send an alert to every mobile phone in
the affected area at exactly the same time.
{% endblock %}
@@ -15,7 +15,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
<h1 class="heading-medium">
In an emergency, you can broadcast an alert to every mobile phone in
In an emergency, you can send an alert to every mobile phone in
the affected area at exactly the same time.
</h1>
<p class="govuk-body heading-medium govuk-!-margin-bottom-6">
+2 -2
View File
@@ -22,13 +22,13 @@
Youre in training mode.
</h1>
<p class="govuk-body heading-medium">
Theres no risk of broadcasting a real alert.
Theres no risk of sending a real alert.
</p>
<p class="govuk-body heading-medium">
Get used to the system now, so you know what to do in an&nbsp;emergency.
</p>
<p class="govuk-body heading-medium">
When youre ready, you can turn off training mode.
When youre ready, you can ask for access to the live system.
</p>
<p class="govuk-body heading-medium">
<a class="govuk-link govuk-link--no-visited-state" href='{{ url_for(".service_dashboard", service_id=current_service.id) }}'>
+2 -2
View File
@@ -3,7 +3,7 @@
{% extends "admin_template.html" %}
{% block per_page_title %}
Notify has not broadcast your alert because youre in training mode.
Notify has not sent your alert because youre in training mode.
{% endblock %}
{% set mainClasses = "govuk-!-padding-top-0 govuk-!-padding-bottom-0" %}
@@ -16,7 +16,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
<h1 class="heading-medium">
Notify has not broadcast your alert because youre in training mode.
Notify has not sent your alert because youre in training mode.
</h1>
<p class="govuk-body heading-medium">
In a real emergency, every mobile phone in the area
@@ -53,7 +53,7 @@
</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='Withdraw this alert'
delete_link_text='Discard this alert'
) }}
{% else %}
<p class="govuk-body govuk-!-margin-bottom-3">
@@ -75,7 +75,7 @@
{{ page_footer(
"Start broadcasting now",
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
delete_link_text='Cancel this alert'
delete_link_text='Reject this alert'
) }}
{% endcall %}
</details>
@@ -124,7 +124,7 @@
<p class="govuk-body govuk-!-margin-bottom-2 live-broadcast live-broadcast--left">
Live since {{ broadcast_message.starts_at|format_datetime_relative }}&ensp;
{%- if not hide_stop_link %}
<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 broadcasting</a>
<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>
{% endif %}
</p>
{% elif broadcast_message.status == 'rejected' %}
@@ -134,7 +134,7 @@
</p>
{% else %}
<p class="govuk-body govuk-!-margin-bottom-4">
Broadcast
Sent
{{ broadcast_message.starts_at|format_datetime_human }}.
</p>
{% endif %}
@@ -165,7 +165,7 @@
{% if broadcast_message.status != 'pending-approval' %}
<p class="govuk-body govuk-!-margin-bottom-3">
{% if broadcast_message.created_by %}
Prepared by {{ broadcast_message.created_by.name }}
Sent by {{ broadcast_message.created_by.name }}
{%- else %}
Created from an API call
{%- endif %}
+1 -1
View File
@@ -31,7 +31,7 @@
{% if current_user.has_permissions('send_messages') %}
<div class="govuk-grid-column-one-half">
<a href="{{ url_for(".broadcast", service_id=current_service.id, template_id=template.id) }}" class="govuk-link govuk-link--no-visited-state pill-separate-item">
Prepare broadcast
Get ready to send
</a>
</div>
{% endif %}
+17 -17
View File
@@ -568,7 +568,7 @@ def test_previous_broadcasts_page(
)
assert normalize_spaces(page.select_one('main h1').text) == (
'Previous alerts'
'Past alerts'
)
assert len(page.select('.ajax-block-container')) == 1
assert [
@@ -1561,15 +1561,15 @@ def test_start_broadcasting(
'status': 'broadcasting',
'finishes_at': '2020-02-23T23:23:23.000000',
}, [
'Live since 20 February at 8:20pm Stop broadcasting',
'Prepared by Alice and approved by Bob.',
'Live since 20 February at 8:20pm Stop sending',
'Sent by Alice and approved by Bob.',
'Broadcasting stops tomorrow at 11:23pm.'
]),
('.view_current_broadcast', True, {
'status': 'broadcasting',
'finishes_at': '2020-02-23T23:23:23.000000',
}, [
'Live since 20 February at 8:20pm Stop broadcasting',
'Live since 20 February at 8:20pm Stop sending',
'Created from an API call and approved by Alice.',
'Broadcasting stops tomorrow at 11:23pm.'
]),
@@ -1577,15 +1577,15 @@ def test_start_broadcasting(
'status': 'broadcasting',
'finishes_at': '2020-02-22T22:20:20.000000', # 2 mins before now()
}, [
'Broadcast on 20 February at 8:20pm.',
'Prepared by Alice and approved by Bob.',
'Sent on 20 February at 8:20pm.',
'Sent by Alice and approved by Bob.',
'Finished broadcasting today at 10:20pm.'
]),
('.view_previous_broadcast', True, {
'status': 'broadcasting',
'finishes_at': '2020-02-22T22:20:20.000000', # 2 mins before now()
}, [
'Broadcast on 20 February at 8:20pm.',
'Sent on 20 February at 8:20pm.',
'Created from an API call and approved by Alice.',
'Finished broadcasting today at 10:20pm.'
]),
@@ -1593,8 +1593,8 @@ def test_start_broadcasting(
'status': 'completed',
'finishes_at': '2020-02-21T21:21:21.000000',
}, [
'Broadcast on 20 February at 8:20pm.',
'Prepared by Alice and approved by Bob.',
'Sent on 20 February at 8:20pm.',
'Sent by Alice and approved by Bob.',
'Finished broadcasting yesterday at 9:21pm.',
]),
('.view_previous_broadcast', False, {
@@ -1602,8 +1602,8 @@ def test_start_broadcasting(
'cancelled_by_id': sample_uuid,
'cancelled_at': '2020-02-21T21:21:21.000000',
}, [
'Broadcast on 20 February at 8:20pm.',
'Prepared by Alice and approved by Bob.',
'Sent on 20 February at 8:20pm.',
'Sent by Alice and approved by Bob.',
'Stopped by Carol yesterday at 9:21pm.',
]),
('.view_rejected_broadcast', False, {
@@ -1611,7 +1611,7 @@ def test_start_broadcasting(
'updated_at': '2020-02-21T21:21:21.000000',
}, [
'Rejected yesterday at 9:21pm.',
'Prepared by Alice and approved by Bob.',
'Sent by Alice and approved by Bob.',
]),
))
@freeze_time('2020-02-22T22:22:22.000000')
@@ -1676,12 +1676,12 @@ def test_view_broadcast_message_page(
),
(
'completed',
'Previous alerts',
'Past alerts',
'.broadcast_dashboard_previous',
),
(
'cancelled',
'Previous alerts',
'Past alerts',
'.broadcast_dashboard_previous',
),
(
@@ -2030,7 +2030,7 @@ def test_cant_approve_own_broadcast(
assert not page.select('form')
link = page.select_one('.banner a.govuk-link.govuk-link--destructive')
assert link.text == 'Withdraw this alert'
assert link.text == 'Discard this alert'
assert link['href'] == url_for(
'.reject_broadcast_message',
service_id=SERVICE_ONE_ID,
@@ -2094,7 +2094,7 @@ def test_can_approve_own_broadcast_in_trial_mode(
'alerts, to see how it works. '
'No real alerts will be broadcast to anyones phone. '
'Start broadcasting now '
'Cancel this alert'
'Reject this alert'
)
form = page.select_one('.banner details form')
@@ -2105,7 +2105,7 @@ def test_can_approve_own_broadcast_in_trial_mode(
)
link = page.select_one('.banner a.govuk-link.govuk-link--destructive')
assert link.text == 'Cancel this alert'
assert link.text == 'Reject this alert'
assert link['href'] == url_for(
'.reject_broadcast_message',
service_id=SERVICE_ONE_ID,
+1 -1
View File
@@ -913,7 +913,7 @@ def test_view_broadcast_template(
(link.text.strip(), link['href'])
for link in page.select('.pill-separate-item')
] == [
('Prepare broadcast', url_for(
('Get ready to send', url_for(
'.broadcast',
service_id=SERVICE_ONE_ID,
template_id=fake_uuid,
+1 -1
View File
@@ -509,7 +509,7 @@ def test_navigation_for_services_with_broadcast_permission(
a['href'] for a in page.select('.navigation a')
] == [
'/services/{}/current-alerts'.format(SERVICE_ONE_ID),
'/services/{}/previous-alerts'.format(SERVICE_ONE_ID),
'/services/{}/past-alerts'.format(SERVICE_ONE_ID),
'/services/{}/rejected-alerts'.format(SERVICE_ONE_ID),
'/services/{}/templates'.format(SERVICE_ONE_ID),
'/services/{}/users'.format(SERVICE_ONE_ID),