From a43321cbb36b63572297ee32ab97967c387a6da7 Mon Sep 17 00:00:00 2001
From: Chris Hill-Scott
- {% endif %}
+ {{ broadcast_message.template|string }}
+
+
+ {% for area in broadcast_message.areas %}
- {% endif %}
- {% endfor %}
-
- {{ broadcast_message.template|string }}
+ {% endfor %}
+
+
- Created by {{ broadcast_message.created_by.name }} and approved by - {{ broadcast_message.approved_by.name }}. -
-Started broadcasting {{ broadcast_message.starts_at|format_datetime_human }}. @@ -147,4 +142,11 @@ }) }} + {% if broadcast_message.status != 'pending-approval' %} +
+ Prepared by {{ broadcast_message.created_by.name }} and approved by + {{ broadcast_message.approved_by.name }}. +
+ {% endif %} + {% endblock %} diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py index be55d22bf..3693abeb2 100644 --- a/tests/app/main/views/test_broadcast.py +++ b/tests/app/main/views/test_broadcast.py @@ -1037,34 +1037,34 @@ def test_start_broadcasting( 'status': 'broadcasting', 'finishes_at': '2020-02-23T23:23:23.000000', }, [ - 'Created by Alice and approved by Bob.', 'Started broadcasting on 20 February at 8:20pm.', 'Live until tomorrow at 11:23pm Stop broadcast early', + 'Prepared by Alice and approved by Bob.', ]), ({ 'status': 'broadcasting', 'finishes_at': '2020-02-22T22:20:20.000000', # 2 mins before now() }, [ - 'Created by Alice and approved by Bob.', 'Started broadcasting on 20 February at 8:20pm.', 'Finished broadcasting today at 10:20pm.', + 'Prepared by Alice and approved by Bob.', ]), ({ 'status': 'finished', 'finishes_at': '2020-02-21T21:21:21.000000', }, [ - 'Created by Alice and approved by Bob.', 'Started broadcasting on 20 February at 8:20pm.', 'Finished broadcasting yesterday at 9:21pm.', + 'Prepared by Alice and approved by Bob.', ]), ({ 'status': 'cancelled', 'cancelled_by_id': sample_uuid, 'cancelled_at': '2020-02-21T21:21:21.000000', }, [ - 'Created by Alice and approved by Bob.', 'Started broadcasting on 20 February at 8:20pm.', - 'Stopped by Carol yesterday at 9:21pm.', + 'Stopped by Alice yesterday at 9:21pm.', + 'Prepared by Bob and approved by Carol.', ]), )) @freeze_time('2020-02-22T22:22:22.000000') From ba535523dfdecfb104c025cddcf188b74116bc42 Mon Sep 17 00:00:00 2001 From: Chris Hill-ScottLive until {{ item.finishes_at|format_datetime_relative }}
- {% elif item.status == 'cancelled' %} -- Stopped {{ item.cancelled_at|format_datetime_relative }} -
{% else %}- Finished {{ item.finishes_at|format_datetime_relative }} + Broadcast {{ item.starts_at|format_datetime_relative }}
{% endif %} {% endcall %} diff --git a/app/templates/views/broadcast/view-message.html b/app/templates/views/broadcast/view-message.html index 5133839aa..59af6615b 100644 --- a/app/templates/views/broadcast/view-message.html +++ b/app/templates/views/broadcast/view-message.html @@ -99,26 +99,20 @@ {% else %} {{ page_header(broadcast_message.template_name) }} -- Started broadcasting - {{ broadcast_message.starts_at|format_datetime_human }}. -
- -- {% if broadcast_message.status == 'pending-approval' %} - Will broadcast until {{ broadcast_message.finishes_at|format_datetime_relative }}. - {% elif broadcast_message.status == 'broadcasting' %} + {% if broadcast_message.status == 'broadcasting' %} +
Live until {{ broadcast_message.finishes_at|format_datetime_relative }} {%- if not hide_stop_link %} - Stop broadcast early + Stop broadcasting {% endif %} - {% elif broadcast_message.status == 'cancelled' %} - Stopped by {{ broadcast_message.cancelled_by.name }} - {{ broadcast_message.cancelled_at|format_datetime_human }}. - {% else %} - Finished broadcasting {{ broadcast_message.finishes_at|format_datetime_human }}. - {% endif %} -
+ + {% else %} ++ Broadcast + {{ broadcast_message.starts_at|format_datetime_human }}. +
+ {% endif %} + {% endif %} {{ broadcast_message.template|string }} @@ -149,4 +143,19 @@ {% endif %} + {% if broadcast_message.status == 'broadcasting' %} ++ Broadcasting stops {{ broadcast_message.finishes_at|format_datetime_human }}. +
+ {% elif broadcast_message.status == 'cancelled' %} ++ Stopped by {{ broadcast_message.cancelled_by.name }} + {{ broadcast_message.cancelled_at|format_datetime_human }}. +
+ {% elif broadcast_message.status == 'completed' %} ++ Finished broadcasting {{ broadcast_message.finishes_at|format_datetime_human }}. +
+ {% endif %} + {% endblock %} diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py index 3693abeb2..4be2e2a1f 100644 --- a/tests/app/main/views/test_broadcast.py +++ b/tests/app/main/views/test_broadcast.py @@ -361,8 +361,8 @@ def test_previous_broadcasts_page( assert [ normalize_spaces(row.text) for row in page.select('table')[0].select('tbody tr') ] == [ - 'Example template This is a test England Scotland Stopped 10 February at 2:20am', - 'Example template This is a test England Scotland Finished yesterday at 8:20pm', + 'Example template This is a test England Scotland Broadcast yesterday at 2:20am', + 'Example template This is a test England Scotland Broadcast yesterday at 2:20pm', ] @@ -1037,34 +1037,34 @@ def test_start_broadcasting( 'status': 'broadcasting', 'finishes_at': '2020-02-23T23:23:23.000000', }, [ - 'Started broadcasting on 20 February at 8:20pm.', - 'Live until tomorrow at 11:23pm Stop broadcast early', + 'Live until tomorrow at 11:23pm Stop broadcasting', 'Prepared by Alice and approved by Bob.', + 'Broadcasting stops tomorrow at 11:23pm.' ]), ({ 'status': 'broadcasting', 'finishes_at': '2020-02-22T22:20:20.000000', # 2 mins before now() }, [ - 'Started broadcasting on 20 February at 8:20pm.', - 'Finished broadcasting today at 10:20pm.', + 'Broadcast on 20 February at 8:20pm.', 'Prepared by Alice and approved by Bob.', + 'Finished broadcasting today at 10:20pm.' ]), ({ - 'status': 'finished', + 'status': 'completed', 'finishes_at': '2020-02-21T21:21:21.000000', }, [ - 'Started broadcasting on 20 February at 8:20pm.', - 'Finished broadcasting yesterday at 9:21pm.', + 'Broadcast on 20 February at 8:20pm.', 'Prepared by Alice and approved by Bob.', + 'Finished broadcasting yesterday at 9:21pm.', ]), ({ 'status': 'cancelled', 'cancelled_by_id': sample_uuid, 'cancelled_at': '2020-02-21T21:21:21.000000', }, [ - 'Started broadcasting on 20 February at 8:20pm.', - 'Stopped by Alice yesterday at 9:21pm.', - 'Prepared by Bob and approved by Carol.', + 'Broadcast on 20 February at 8:20pm.', + 'Prepared by Alice and approved by Bob.', + 'Stopped by Carol yesterday at 9:21pm.', ]), )) @freeze_time('2020-02-22T22:22:22.000000') From 91e74929eb76f83c2052a708ddb8ce03d2e7fdaa Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott+
Live until {{ broadcast_message.finishes_at|format_datetime_relative }}
{%- if not hide_stop_link %}
Stop broadcasting
From 0e392085464da0f17e62550d3504043fd3d77758 Mon Sep 17 00:00:00 2001
From: Chris Hill-Scott
- Live until {{ item.finishes_at|format_datetime_relative }} + Live since {{ item.starts_at|format_datetime_relative }}
{% else %}diff --git a/app/templates/views/broadcast/view-message.html b/app/templates/views/broadcast/view-message.html index f75265387..5d1c9aff6 100644 --- a/app/templates/views/broadcast/view-message.html +++ b/app/templates/views/broadcast/view-message.html @@ -101,7 +101,7 @@ {% if broadcast_message.status == 'broadcasting' %}
- Live until {{ broadcast_message.finishes_at|format_datetime_relative }} + Live since {{ broadcast_message.starts_at|format_datetime_relative }} {%- if not hide_stop_link %} Stop broadcasting {% endif %} diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py index 4be2e2a1f..774875cdd 100644 --- a/tests/app/main/views/test_broadcast.py +++ b/tests/app/main/views/test_broadcast.py @@ -302,7 +302,7 @@ def test_broadcast_dashboard( assert [ normalize_spaces(row.text) for row in page.select('table')[0].select('tbody tr') ] == [ - 'Example template This is a test England Scotland Live until tomorrow at 2:20am', + 'Example template This is a test England Scotland Live since today at 2:20am', ] assert normalize_spaces(page.select('main h2')[1].text) == ( @@ -338,7 +338,7 @@ def test_broadcast_dashboard_json( } assert 'Prepared by Test User' in json_response['pending_approval_broadcasts'] - assert 'Live until tomorrow at 2:20am' in json_response['live_broadcasts'] + assert 'Live since today at 2:20am' in json_response['live_broadcasts'] @freeze_time('2020-02-20 02:20') @@ -1037,7 +1037,7 @@ def test_start_broadcasting( 'status': 'broadcasting', 'finishes_at': '2020-02-23T23:23:23.000000', }, [ - 'Live until tomorrow at 11:23pm Stop broadcasting', + 'Live since 20 February at 8:20pm Stop broadcasting', 'Prepared by Alice and approved by Bob.', 'Broadcasting stops tomorrow at 11:23pm.' ]),