From ad1fe752e79aad8dc60236307065c38d8a209a74 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 20 Jul 2020 15:41:39 +0100 Subject: [PATCH 1/3] Swap order of live and pending --- app/templates/views/broadcast/dashboard.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/templates/views/broadcast/dashboard.html b/app/templates/views/broadcast/dashboard.html index c44257e62..7ab330edb 100644 --- a/app/templates/views/broadcast/dashboard.html +++ b/app/templates/views/broadcast/dashboard.html @@ -10,14 +10,6 @@

Dashboard

-

Waiting for approval

- - {{ ajax_block( - partials, - url_for('.broadcast_dashboard_updates', service_id=current_service.id), - 'pending_approval_broadcasts' - ) }} -

Live broadcasts

{{ ajax_block( @@ -26,6 +18,14 @@ 'live_broadcasts' ) }} +

Waiting for approval

+ + {{ ajax_block( + partials, + url_for('.broadcast_dashboard_updates', service_id=current_service.id), + 'pending_approval_broadcasts' + ) }} +

Previous broadcasts

{{ ajax_block( From aed9bc3695f0cf33cfbaa3cfa0db6998b7703464 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 21 Jul 2020 09:05:24 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Add=20a=20=E2=80=98live=20broadcast?= =?UTF-8?q?=E2=80=99=20indicator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a reckon that live broadcasts don’t feel prominent, consequential or active enough on the dashboard. This commit adds an animated component, similar to an ‘on air’ indicator in a broadcast studio, or a ‘recording’ indicator on a video camera. This is one option for addressing our reckon. We shouldn’t merge this until we have a better understanding of the problem from another round of user research. --- app/assets/stylesheets/app.scss | 43 +++++++++++++++++++ .../broadcast/partials/dashboard-table.html | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/app.scss b/app/assets/stylesheets/app.scss index 1135d69ab..ff4582e89 100644 --- a/app/assets/stylesheets/app.scss +++ b/app/assets/stylesheets/app.scss @@ -210,3 +210,46 @@ details .arrow { .heading-upcoming-jobs { margin-top: govuk-spacing(3); } + +@keyframes live-pulse { + 0% { + background: $red; + box-shadow: inset 0 0 0 2px $red, inset 0 0 0 4px $white; + } + 40% { + background: $red; + box-shadow: inset 0 0 0 2px $red, inset 0 0 0 4px $white; + } + 50% { + background: $white; + box-shadow: inset 0 0 0 2px $red, inset 0 0 0 2px $white; + } + 100% { + background: $white; + box-shadow: inset 0 0 0 2px $red, inset 0 0 0 4px $white; + } +} + +.live-broadcast { + + color: $red; + font-weight: bold; + position: relative; + display: inline-block; + + &:before { + content: ""; + display: block; + float: right; + margin-top: 1px; + margin-left: 5px; + border: none; + background: $red; + width: 19px; + height: 19px; + border-radius: 50%; + animation: live-pulse 1.5s infinite; + //box-shadow: inset 0 0 0 2px $red, inset 0 0 0 5px $white; + } + +} diff --git a/app/templates/views/broadcast/partials/dashboard-table.html b/app/templates/views/broadcast/partials/dashboard-table.html index dbd342917..ea4bbb586 100644 --- a/app/templates/views/broadcast/partials/dashboard-table.html +++ b/app/templates/views/broadcast/partials/dashboard-table.html @@ -26,7 +26,7 @@ Prepared by {{ item.created_by.name }}

{% elif item.status == 'broadcasting' %} -

+

Live until {{ item.finishes_at|format_datetime_relative }}

{% elif item.status == 'cancelled' %} From 8f0c6e43c119d25e1a249c342f04ec312d9ad6bd Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Wed, 22 Jul 2020 15:15:23 +0100 Subject: [PATCH 3/3] fix tests --- tests/app/main/views/test_broadcast.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py index a99b6193d..1adce2a6a 100644 --- a/tests/app/main/views/test_broadcast.py +++ b/tests/app/main/views/test_broadcast.py @@ -103,8 +103,8 @@ def test_empty_broadcast_dashboard( assert [ normalize_spaces(row.text) for row in page.select('tbody tr .table-empty-message') ] == [ - 'You do not have any broadcasts waiting for approval', 'You do not have any live broadcasts at the moment', + 'You do not have any broadcasts waiting for approval', 'You do not have any previous broadcasts', ] @@ -120,22 +120,23 @@ def test_broadcast_dashboard( '.broadcast_dashboard', service_id=SERVICE_ONE_ID, ) + assert normalize_spaces(page.select('main h2')[0].text) == ( - 'Waiting for approval' + 'Live broadcasts' ) assert [ normalize_spaces(row.text) for row in page.select('table')[0].select('tbody tr') ] == [ - 'Example template To England and Scotland Prepared by Test User', + 'Example template To England and Scotland Live until tomorrow at 2:20am', ] assert normalize_spaces(page.select('main h2')[1].text) == ( - 'Live broadcasts' + 'Waiting for approval' ) assert [ normalize_spaces(row.text) for row in page.select('table')[1].select('tbody tr') ] == [ - 'Example template To England and Scotland Live until tomorrow at 2:20am', + 'Example template To England and Scotland Prepared by Test User', ] assert normalize_spaces(page.select('main h2')[2].text) == (