示例#1
0
def get_broadcast_dashboard_partials(service_id):
    broadcast_messages = BroadcastMessages(service_id)
    return dict(current_broadcasts=render_template(
        'views/broadcast/partials/dashboard-table.html',
        broadcasts=broadcast_messages.with_status('pending-approval',
                                                  'broadcasting'),
        empty_message='You do not have any current alerts',
        view_broadcast_endpoint='.view_current_broadcast',
    ), )
def broadcast_dashboard_previous(service_id):
    return render_template(
        'views/broadcast/previous-broadcasts.html',
        broadcasts=BroadcastMessages(service_id).with_status('cancelled', 'completed'),
        empty_message='You do not have any previous alerts',
        view_broadcast_endpoint='.view_previous_broadcast',
    )
def broadcast_dashboard_rejected(service_id):
    return render_template(
        'views/broadcast/previous-broadcasts.html',
        broadcasts=BroadcastMessages(service_id).with_status('rejected', ),
        page_title='Rejected alerts',
        empty_message='You do not have any rejected alerts',
        view_broadcast_endpoint='.view_rejected_broadcast',
    )
def get_broadcast_dashboard_partials(service_id):
    broadcast_messages = BroadcastMessages(service_id)
    return dict(
        pending_approval_broadcasts=render_template(
            'views/broadcast/partials/dashboard-table.html',
            broadcasts=broadcast_messages.with_status('pending-approval'),
            empty_message='You do not have any broadcasts waiting for approval',
        ),
        live_broadcasts=render_template(
            'views/broadcast/partials/dashboard-table.html',
            broadcasts=broadcast_messages.with_status('broadcasting'),
            empty_message='You do not have any live broadcasts at the moment',
        ),
        previous_broadcasts=render_template(
            'views/broadcast/partials/dashboard-table.html',
            broadcasts=broadcast_messages.with_status('cancelled',
                                                      'completed'),
            empty_message='You do not have any previous broadcasts',
        ),
    )