Allow broadcasts to be cancelled

Currently this is a `get` request from the dashboard. Once we have a page
for viewing an individual broadcast it should probably show there
instead and be a `get`/confirm/`post` loop like for deleting a template.
This commit is contained in:
Chris Hill-Scott
2020-07-10 09:16:36 +01:00
parent 23cd6b9c9e
commit 44e177b402
5 changed files with 62 additions and 7 deletions

View File

@@ -24,15 +24,20 @@
</div>
{% endcall %}
{% call field(align='right') %}
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0">
{% if item.status == 'broadcasting' %}
{% if item.status == 'broadcasting' %}
<p class="govuk-body letter-recipient-summary">
Live until {{ item.finishes_at|format_datetime_relative }}
{% elif item.status == 'cancelled' %}
<a href="{{ url_for('.cancel_broadcast_message', service_id=current_service.id, broadcast_message_id=item.id) }}" class="destructive-link destructive-link--no-visited-state">Stop broadcasting</a>
</p>
{% elif item.status == 'cancelled' %}
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0">
Stopped {{ item.cancelled_at|format_datetime_relative }}
{% else %}
</p>
{% else %}
<p class="govuk-body govuk-!-margin-top-6 govuk-!-margin-bottom-0">
Finished {{ item.finishes_at|format_datetime_relative }}
{% endif %}
</p>
</p>
{% endif %}
{% endcall %}
{% endcall %}
</div>