From 73c5aa9bb703b5c9c9f53fac140cd683cf27d7d6 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 17 Jul 2020 08:07:41 +0100 Subject: [PATCH] Add page for broadcast in pending state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we’ll be linking to pending broadcasts from the dashboard, the page needs to be ready to display them. Pending broadcasts lack a few bits of information that live or previous broadcasts have (like the start date for example). So this commit hides the code that displays those bits of information. --- .../views/broadcast/view-message.html | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/app/templates/views/broadcast/view-message.html b/app/templates/views/broadcast/view-message.html index 625190db9..9d534473e 100644 --- a/app/templates/views/broadcast/view-message.html +++ b/app/templates/views/broadcast/view-message.html @@ -16,26 +16,35 @@ back_link=url_for('.broadcast_dashboard', service_id=current_service.id) ) }} -

- Created by {{ broadcast_message.created_by.name }} and approved by - {{ broadcast_message.approved_by.name }}. -

+ {% if broadcast_message.status == 'pending-approval' %} +

+ {{ broadcast_message.created_by.name }} wants to broadcast this + message until {{ broadcast_message.finishes_at|format_datetime_relative }}. +

+ {% else %} +

+ Created by {{ broadcast_message.created_by.name }} and approved by + {{ broadcast_message.approved_by.name }}. +

-

- Started broadcasting - {{ broadcast_message.starts_at|format_datetime_human }}. -

+

+ Started broadcasting + {{ broadcast_message.starts_at|format_datetime_human }}. +

-

- {% if broadcast_message.status == 'broadcasting' %} - Live until {{ broadcast_message.finishes_at|format_datetime_relative }} Stop broadcast early - {% 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 %} -

+

+ {% if broadcast_message.status == 'pending-approval' %} + Will broadcast until {{ broadcast_message.finishes_at|format_datetime_relative }}. + {% elif broadcast_message.status == 'broadcasting' %} + Live until {{ broadcast_message.finishes_at|format_datetime_relative }} Stop broadcast early + {% 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 %} +

+ {% endif %} {% for area in broadcast_message.areas %} {% if loop.first %}