+
+ An area of {{ "{:,.1f}".format(broadcast_message.simple_polygons.estimated_area) }} square miles
+
+ Will get
+ the
+ alert
+
+
+
+ An extra area of {{ "{:,.1f}".format(broadcast_message.simple_polygons.bleed.estimated_area - broadcast_message.simple_polygons.estimated_area) }} square miles is
+
+ Likely to get
+
+ the
+
+ alert
+
+
+{% endmacro %}
diff --git a/app/templates/views/broadcast/partials/area-map-javascripts.html b/app/templates/views/broadcast/partials/area-map-javascripts.html
index 5d1fcb37e..6111f6be2 100644
--- a/app/templates/views/broadcast/partials/area-map-javascripts.html
+++ b/app/templates/views/broadcast/partials/area-map-javascripts.html
@@ -5,10 +5,10 @@
{% for polygon in broadcast_message.simple_polygons.bleed.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
- opacity: 0.5,
- color: '#2B8CC4', // $light-blue
- fillColor: '#2B8CC4', // $light-blue
- fillOpacity: 0.2,
+ opacity: 0.8,
+ color: '#005ea5', // $light-blue
+ fillColor: '#005ea5', // $light-blue
+ fillOpacity: 0.15,
weight: 2
})
);
@@ -17,10 +17,10 @@
{% for polygon in broadcast_message.simple_polygons.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
- opacity: 0.1,
- color: '#2B8CC4', // $black
- fillColor: '#2B8CC4', // $light-blue
- fillOpacity: 0.4,
+ opacity: 0.3,
+ color: '#005ea5', // $black
+ fillColor: '#005ea5', // $light-blue
+ fillOpacity: 0.3,
weight: 1
})
);
diff --git a/app/templates/views/broadcast/partials/area-map-stylesheets.html b/app/templates/views/broadcast/partials/area-map-stylesheets.html
index cb1333424..e007724a1 100644
--- a/app/templates/views/broadcast/partials/area-map-stylesheets.html
+++ b/app/templates/views/broadcast/partials/area-map-stylesheets.html
@@ -1,8 +1 @@
-
diff --git a/app/templates/views/broadcast/preview-areas.html b/app/templates/views/broadcast/preview-areas.html
index acc5dc2fa..9e1efad65 100644
--- a/app/templates/views/broadcast/preview-areas.html
+++ b/app/templates/views/broadcast/preview-areas.html
@@ -1,6 +1,7 @@
{% from "components/button/macro.njk" import govukButton %}
{% from "components/page-header.html" import page_header %}
-{% from "components/page-footer.html" import sticky_page_footer %}
+{% from "components/page-footer.html" import page_footer %}
+{% from "views/broadcast/macros/area-map.html" import map %}
{% extends "withnav_template.html" %}
@@ -51,9 +52,9 @@
{% endfor %}
{% if broadcast_message.areas %}
-
+ {{ map(broadcast_message) }}
{% endif %}
diff --git a/app/templates/views/broadcast/view-message.html b/app/templates/views/broadcast/view-message.html
index 29db61202..236090bc5 100644
--- a/app/templates/views/broadcast/view-message.html
+++ b/app/templates/views/broadcast/view-message.html
@@ -5,6 +5,7 @@
{% from "components/banner.html" import banner %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
+{% from "views/broadcast/macros/area-map.html" import map %}
{% extends "withnav_template.html" %}
@@ -139,7 +140,7 @@
{{ govukDetails({
"summaryText": "Show map",
- "html": ''
+ "html": map(broadcast_message)
}) }}
{{ broadcast_message.template|string }}
diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py
index 565b422c4..71aa2a43b 100644
--- a/tests/app/main/views/test_broadcast.py
+++ b/tests/app/main/views/test_broadcast.py
@@ -331,12 +331,30 @@ def test_preview_broadcast_areas_page(
mock_get_draft_broadcast_message,
):
service_one['permissions'] += ['broadcast']
- client_request.get(
+ page = client_request.get(
'.preview_broadcast_areas',
service_id=SERVICE_ONE_ID,
broadcast_message_id=fake_uuid,
)
+ assert [
+ normalize_spaces(item.text)
+ for item in page.select('ul.area-list li.area-list-item')
+ ] == [
+ 'England remove',
+ 'Scotland remove',
+ ]
+
+ assert len(page.select('#map')) == 1
+
+ assert [
+ normalize_spaces(item.text)
+ for item in page.select('ul li.area-key')
+ ] == [
+ 'An area of 176,714.9 square miles Will get the alert',
+ 'An extra area of 3,052.8 square miles is Likely to get the alert',
+ ]
+
def test_choose_broadcast_library_page(
client_request,