mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Add a page to view a single broadcast
This commit adds a page to view a single broadcast. This is important for two reasons: - users need an audit of what happened when, and who else was involved in approving or cancelling a broadcast - we need a place to put actions (approving, cancelling) on a broadcast so that you can confirm details of the message and the areas before performing the action
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from flask import redirect, render_template, request, url_for
|
||||
from flask import abort, redirect, render_template, request, url_for
|
||||
|
||||
from app import current_service
|
||||
from app.main import main
|
||||
@@ -19,7 +19,7 @@ def broadcast_dashboard(service_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route('/services/<uuid:service_id>/broadcast/<uuid:template_id>')
|
||||
@main.route('/services/<uuid:service_id>/new-broadcast/<uuid:template_id>')
|
||||
@user_has_permissions('send_messages')
|
||||
@service_has_permission('broadcast')
|
||||
def broadcast(service_id, template_id):
|
||||
@@ -127,6 +127,22 @@ def preview_broadcast_message(service_id, broadcast_message_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route('/services/<uuid:service_id>/broadcast/<uuid:broadcast_message_id>')
|
||||
@user_has_permissions('send_messages')
|
||||
@service_has_permission('broadcast')
|
||||
def view_broadcast_message(service_id, broadcast_message_id):
|
||||
broadcast_message = BroadcastMessage.from_id(
|
||||
broadcast_message_id,
|
||||
service_id=current_service.id,
|
||||
)
|
||||
if broadcast_message.status == 'draft':
|
||||
abort(404)
|
||||
return render_template(
|
||||
'views/broadcast/view-message.html',
|
||||
broadcast_message=broadcast_message,
|
||||
)
|
||||
|
||||
|
||||
@main.route('/services/<uuid:service_id>/broadcast/<uuid:broadcast_message_id>/cancel')
|
||||
@user_has_permissions('send_messages')
|
||||
@service_has_permission('broadcast')
|
||||
|
||||
Reference in New Issue
Block a user