mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-03 23:51:22 -04:00
Messages awaiting approval don’t have an end time – it’s set automatically once the message is approved. We need to revisit the content on this page, but this is just a fix so that the page doesn’t `500`.
92 lines
3.6 KiB
HTML
92 lines
3.6 KiB
HTML
{% from "components/button/macro.njk" import govukButton %}
|
||
{% from "components/form.html" import form_wrapper %}
|
||
{% from "components/banner.html" import banner %}
|
||
{% from "components/page-header.html" import page_header %}
|
||
{% from "components/page-footer.html" import page_footer %}
|
||
|
||
{% extends "withnav_template.html" %}
|
||
|
||
{% block service_page_title %}
|
||
{{ broadcast_message.template_name }}
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
{{ page_header(
|
||
broadcast_message.template_name,
|
||
back_link=url_for('.broadcast_dashboard', service_id=current_service.id)
|
||
) }}
|
||
|
||
{% if broadcast_message.status == 'pending-approval' %}
|
||
{% if broadcast_message.created_by == current_user and current_user.has_permissions('send_messages') %}
|
||
<div class="banner govuk-!-margin-bottom-6">
|
||
<h2 class="govuk-heading-s govuk-!-margin-bottom-3">Your broadcast is waiting for approval from another member of your team</h2>
|
||
{{ page_footer(
|
||
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
|
||
delete_link_text='Withdraw this broadcast'
|
||
) }}
|
||
</div>
|
||
{% elif current_user.has_permissions('send_messages') %}
|
||
{% call form_wrapper(class="banner govuk-!-margin-bottom-6") %}
|
||
<p class="govuk-body govuk-!-margin-top-0 govuk-!-margin-bottom-3">
|
||
{{ broadcast_message.created_by.name }} wants to broadcast this
|
||
message.
|
||
</p>
|
||
{{ page_footer(
|
||
"Start broadcasting now",
|
||
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
|
||
delete_link_text='Reject this broadcast'
|
||
) }}
|
||
{% endcall %}
|
||
{% else %}
|
||
<div class="banner govuk-!-margin-bottom-6">
|
||
<h2 class="govuk-heading-s govuk-!-margin-bottom-3">This broadcast is waiting for approval</h2>
|
||
<p class="govuk-body">
|
||
You don’t have permission to approve broadcasts.
|
||
</p>
|
||
</div>
|
||
{% endif %}
|
||
{% else %}
|
||
<p class="govuk-body govuk-!-margin-bottom-3">
|
||
Created by {{ broadcast_message.created_by.name }} and approved by
|
||
{{ broadcast_message.approved_by.name }}.
|
||
</p>
|
||
|
||
<p class="govuk-body govuk-!-margin-bottom-3">
|
||
Started broadcasting
|
||
{{ 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 }} 
|
||
{%- 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>
|
||
{% 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 %}
|
||
</p>
|
||
{% endif %}
|
||
|
||
{% for area in broadcast_message.areas %}
|
||
{% if loop.first %}
|
||
<ul class="area-list">
|
||
{% endif %}
|
||
<li class="area-list-item area-list-item--unremoveable">
|
||
{{ area.name }}
|
||
</li>
|
||
{% if loop.last %}
|
||
</ul>
|
||
{% endif %}
|
||
{% endfor %}
|
||
|
||
{{ broadcast_message.template|string }}
|
||
|
||
{% endblock %}
|