mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Combine current and pending broadcasts
Splitting the dashboard into multiple sections was confusing, and people sometimes mistook the headings as labels, especially when a section was empty. It just wasn’t clear what the hierarchy of the page was. This commit combines the current and pending broadcasts into one list on the dashboard. Previous broadcasts have already moved to their own page.
This commit is contained in:
@@ -62,16 +62,10 @@ def broadcast_dashboard_updates(service_id):
|
||||
def get_broadcast_dashboard_partials(service_id):
|
||||
broadcast_messages = BroadcastMessages(service_id)
|
||||
return dict(
|
||||
pending_approval_broadcasts=render_template(
|
||||
current_broadcasts=render_template(
|
||||
'views/broadcast/partials/dashboard-table.html',
|
||||
broadcasts=broadcast_messages.with_status('pending-approval'),
|
||||
empty_message='You do not have any alerts waiting for approval',
|
||||
view_broadcast_endpoint='.view_current_broadcast',
|
||||
),
|
||||
live_broadcasts=render_template(
|
||||
'views/broadcast/partials/dashboard-table.html',
|
||||
broadcasts=broadcast_messages.with_status('broadcasting'),
|
||||
empty_message='You do not have any live alerts at the moment',
|
||||
broadcasts=broadcast_messages.with_status('pending-approval', 'broadcasting'),
|
||||
empty_message='You do not have any current alerts',
|
||||
view_broadcast_endpoint='.view_current_broadcast',
|
||||
),
|
||||
)
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Dashboard
|
||||
Current alerts
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="govuk-visually-hidden">Dashboard</h1>
|
||||
|
||||
{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %}
|
||||
<nav class="govuk-!-margin-top-2 govuk-!-margin-bottom-6">
|
||||
<a class="govuk-link govuk-link--no-visited-state pill-separate-item govuk-!-padding-top-4 govuk-!-padding-bottom-4 govuk-!-font-weight-bold" href="{{ url_for('.choose_template', service_id=current_service.id) }}">
|
||||
@@ -18,20 +16,12 @@
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
<h2 class="heading-medium govuk-!-margin-bottom-2">Live alerts</h2>
|
||||
<h1 class="heading-medium govuk-!-margin-bottom-2">Current alerts</h1>
|
||||
|
||||
{{ ajax_block(
|
||||
partials,
|
||||
url_for('.broadcast_dashboard_updates', service_id=current_service.id),
|
||||
'live_broadcasts'
|
||||
) }}
|
||||
|
||||
<h2 class="heading-medium govuk-!-margin-bottom-2">Waiting for approval</h2>
|
||||
|
||||
{{ ajax_block(
|
||||
partials,
|
||||
url_for('.broadcast_dashboard_updates', service_id=current_service.id),
|
||||
'pending_approval_broadcasts'
|
||||
'current_broadcasts'
|
||||
) }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user