示例#1
0
def campus_gateways(campus_id):
    return render_template(
        'developer/console/campus/gateways.html',
        campus=Campus.objects(id=campus_id).get(),
        gateways=CampusGateway.objects(campus_id=campus_id),
        menu='gateways',
        gateway_method_ids=GATEWAY_METHOD_IDS,
        module_menus=modulemanager.get_manager_menus()
    )
示例#2
0
def campus_menus(campus_id):
    if request.method == 'POST':
        menus = json.loads(request.form.get('menus'))
        request.campus.menus = json.dumps(menus)
        request.campus.save()

    def encode_menu(data):
        data = data.copy()
        del data['children']
        import json
        import urllib.parse
        return urllib.parse.quote(json.dumps(data).encode('utf-8'))

    return render_template(
        'developer/console/campus/menus.html',
        campus=Campus.objects(id=campus_id).get(),
        menu='menus',
        module_menus=modulemanager.get_manager_menus(),
        campus_service_menus=modulemanager.get_campus_service_menus(),
        encode_menu=encode_menu
    )
示例#3
0
def lecture_manager():
    return render_template('module/lecture/manager/lecture_manager.html',
                           module_menus=modulemanager.get_manager_menus())
示例#4
0
def campus_state(campus_id):
    return render_template('developer/console/campus/state.html',
                           campus=Campus.objects(id=campus_id).get(),
                           menu='state',
                           is_super_user=is_super_user(),
                           module_menus=modulemanager.get_manager_menus())