def service_dashboard(service_id):

    if session.get('invited_user'):
        session.pop('invited_user', None)
        session['service_id'] = service_id

    return render_template(
        'views/dashboard/dashboard.html',
        updates_url=url_for(".service_dashboard_updates", service_id=service_id),
        templates=service_api_client.get_service_templates(service_id)['data'],
        partials=get_dashboard_partials(service_id)
    )
Exemple #2
0
def choose_template(service_id, template_type):
    if template_type not in ['email', 'sms']:
        abort(404)
    return render_template(
        'views/templates/choose.html',
        templates=[
            Template(
                template,
                prefix=current_service['name']
            ) for template in service_api_client.get_service_templates(service_id)['data']
            if template['template_type'] == template_type
        ],
        template_type=template_type,
        page_heading=get_page_headings(template_type)
    )