mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Move end time to bottom of page
End time is less important than the status of the broadcast, or when it was started (eg when it was received by most people in the area).
This commit is contained in:
@@ -34,13 +34,9 @@
|
|||||||
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0 live-broadcast">
|
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0 live-broadcast">
|
||||||
Live until {{ item.finishes_at|format_datetime_relative }}
|
Live until {{ item.finishes_at|format_datetime_relative }}
|
||||||
</p>
|
</p>
|
||||||
{% elif item.status == 'cancelled' %}
|
|
||||||
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0 govuk-hint">
|
|
||||||
Stopped {{ item.cancelled_at|format_datetime_relative }}
|
|
||||||
</p>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0 govuk-hint">
|
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0 govuk-hint">
|
||||||
Finished {{ item.finishes_at|format_datetime_relative }}
|
Broadcast {{ item.starts_at|format_datetime_relative }}
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|||||||
@@ -99,26 +99,20 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{{ page_header(broadcast_message.template_name) }}
|
{{ page_header(broadcast_message.template_name) }}
|
||||||
|
|
||||||
<p class="govuk-body govuk-!-margin-bottom-3">
|
{% if broadcast_message.status == 'broadcasting' %}
|
||||||
Started broadcasting
|
<p class="govuk-body">
|
||||||
{{ broadcast_message.starts_at|format_datetime_human }}.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="govuk-body">
|
|
||||||
{% 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 }} 
|
Live until {{ broadcast_message.finishes_at|format_datetime_relative }} 
|
||||||
{%- if not hide_stop_link %}
|
{%- 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 broadcast early</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 broadcasting</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elif broadcast_message.status == 'cancelled' %}
|
</p>
|
||||||
Stopped by {{ broadcast_message.cancelled_by.name }}
|
{% else %}
|
||||||
{{ broadcast_message.cancelled_at|format_datetime_human }}.
|
<p class="govuk-body govuk-!-margin-bottom-4">
|
||||||
{% else %}
|
Broadcast
|
||||||
Finished broadcasting {{ broadcast_message.finishes_at|format_datetime_human }}.
|
{{ broadcast_message.starts_at|format_datetime_human }}.
|
||||||
{% endif %}
|
</p>
|
||||||
</p>
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ broadcast_message.template|string }}
|
{{ broadcast_message.template|string }}
|
||||||
@@ -149,4 +143,19 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if broadcast_message.status == 'broadcasting' %}
|
||||||
|
<p class="govuk-body">
|
||||||
|
Broadcasting stops {{ broadcast_message.finishes_at|format_datetime_human }}.
|
||||||
|
</p>
|
||||||
|
{% elif broadcast_message.status == 'cancelled' %}
|
||||||
|
<p class="govuk-body">
|
||||||
|
Stopped by {{ broadcast_message.cancelled_by.name }}
|
||||||
|
{{ broadcast_message.cancelled_at|format_datetime_human }}.
|
||||||
|
</p>
|
||||||
|
{% elif broadcast_message.status == 'completed' %}
|
||||||
|
<p class="govuk-body">
|
||||||
|
Finished broadcasting {{ broadcast_message.finishes_at|format_datetime_human }}.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -361,8 +361,8 @@ def test_previous_broadcasts_page(
|
|||||||
assert [
|
assert [
|
||||||
normalize_spaces(row.text) for row in page.select('table')[0].select('tbody tr')
|
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 Broadcast yesterday 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:20pm',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -1037,34 +1037,34 @@ def test_start_broadcasting(
|
|||||||
'status': 'broadcasting',
|
'status': 'broadcasting',
|
||||||
'finishes_at': '2020-02-23T23:23:23.000000',
|
'finishes_at': '2020-02-23T23:23:23.000000',
|
||||||
}, [
|
}, [
|
||||||
'Started broadcasting on 20 February at 8:20pm.',
|
'Live until tomorrow at 11:23pm Stop broadcasting',
|
||||||
'Live until tomorrow at 11:23pm Stop broadcast early',
|
|
||||||
'Prepared by Alice and approved by Bob.',
|
'Prepared by Alice and approved by Bob.',
|
||||||
|
'Broadcasting stops tomorrow at 11:23pm.'
|
||||||
]),
|
]),
|
||||||
({
|
({
|
||||||
'status': 'broadcasting',
|
'status': 'broadcasting',
|
||||||
'finishes_at': '2020-02-22T22:20:20.000000', # 2 mins before now()
|
'finishes_at': '2020-02-22T22:20:20.000000', # 2 mins before now()
|
||||||
}, [
|
}, [
|
||||||
'Started broadcasting on 20 February at 8:20pm.',
|
'Broadcast on 20 February at 8:20pm.',
|
||||||
'Finished broadcasting today at 10:20pm.',
|
|
||||||
'Prepared by Alice and approved by Bob.',
|
'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',
|
'finishes_at': '2020-02-21T21:21:21.000000',
|
||||||
}, [
|
}, [
|
||||||
'Started broadcasting on 20 February at 8:20pm.',
|
'Broadcast on 20 February at 8:20pm.',
|
||||||
'Finished broadcasting yesterday at 9:21pm.',
|
|
||||||
'Prepared by Alice and approved by Bob.',
|
'Prepared by Alice and approved by Bob.',
|
||||||
|
'Finished broadcasting yesterday at 9:21pm.',
|
||||||
]),
|
]),
|
||||||
({
|
({
|
||||||
'status': 'cancelled',
|
'status': 'cancelled',
|
||||||
'cancelled_by_id': sample_uuid,
|
'cancelled_by_id': sample_uuid,
|
||||||
'cancelled_at': '2020-02-21T21:21:21.000000',
|
'cancelled_at': '2020-02-21T21:21:21.000000',
|
||||||
}, [
|
}, [
|
||||||
'Started broadcasting on 20 February at 8:20pm.',
|
'Broadcast on 20 February at 8:20pm.',
|
||||||
'Stopped by Alice yesterday at 9:21pm.',
|
'Prepared by Alice and approved by Bob.',
|
||||||
'Prepared by Bob and approved by Carol.',
|
'Stopped by Carol yesterday at 9:21pm.',
|
||||||
]),
|
]),
|
||||||
))
|
))
|
||||||
@freeze_time('2020-02-22T22:22:22.000000')
|
@freeze_time('2020-02-22T22:22:22.000000')
|
||||||
|
|||||||
Reference in New Issue
Block a user