Ejemplo n.º 1
0
def __handle_post_theme():
    selected = context.form.get('theme', '')
    dict = __handle_get_theme()
    if selected in dict['themes']:
        shared.save_setting('theme', 'selected', selected)
        dict['selected'] = selected
        dict['message'] = 'New theme applied. <a href="/" target="_blank">View Site</a>'
    return dict
Ejemplo n.º 2
0
def __handle_post_theme():
    selected = context.form.get('theme', '')
    dict = __handle_get_theme()
    if selected in dict['themes']:
        shared.save_setting('theme', 'selected', selected)
        dict['selected'] = selected
        dict[
            'message'] = 'New theme applied. <a href="/" target="_blank">View Site</a>'
    return dict
Ejemplo n.º 3
0
def __handle_post_settings():
    '''
    update settings of wiki
    '''
    entry = context.form.get('entry', 'Main Page')
    shared.save_setting('wiki', 'entry', entry)
    dict = __handle_get_settings();
    dict['message'] = 'Your wiki settings are saved.'
    return dict
Ejemplo n.º 4
0
def __handle_post_settings():
    '''
    update settings of wiki
    '''
    entry = context.form.get('entry', 'Main Page')
    shared.save_setting('wiki', 'entry', entry)
    dict = __handle_get_settings()
    dict['message'] = 'Your wiki settings are saved.'
    return dict
Ejemplo n.º 5
0
def update_model(rootpath, appname, model):

    # set current theme = 'simple':
    theme = shared.get_setting('theme', 'selected', '')
    if not theme:
        themes = manage.get_themes()
        theme = themes[0]
        shared.save_setting('theme', 'selected', theme)
    model['theme'] = theme
    # add widgets:
    instances = widget.get_widget_instances()
    all_settings = widget.get_all_instances_settings()
    widget.bind_instance_model(instances, all_settings)
    import logging
    model['widgets'] = instances
    model['show_widget__raw__'] = show_widget
    logging.warning('loaded ' + str(instances))
Ejemplo n.º 6
0
def update_model(rootpath, appname, model):

    # set current theme = 'simple':
    theme = shared.get_setting('theme', 'selected', '')
    if not theme:
        themes = manage.get_themes()
        theme = themes[0]
        shared.save_setting('theme', 'selected', theme)
    model['theme'] = theme
    # add widgets:
    instances = widget.get_widget_instances()
    all_settings = widget.get_all_instances_settings()
    widget.bind_instance_model(instances, all_settings)
    import logging
    model['widgets'] = instances
    model['show_widget__raw__'] = show_widget
    logging.warning('loaded ' + str(instances))
Ejemplo n.º 7
0
def __handle_post_storage():
    form = context.form
    args = form.arguments()
    if 'photo_provider' in args:
        shared.save_setting('storage', 'photo_provider', form.get('photo_provider'))
        photo_args = [arg for arg in args if arg.startswith('storage_photo_')]
        for arg in photo_args:
            shared.save_setting('storage', arg, form.get(arg, ''))
    shared.save_setting('storage', 'photo_proxied', form.get('photo_proxied'))
    shared.save_setting('storage', 'file_proxied', form.get('file_proxied'))
    dict = __handle_get_storage()
    dict['message'] = 'Your storage settings are saved.'
    return dict
Ejemplo n.º 8
0
def __handle_post_storage():
    form = context.form
    args = form.arguments()
    if 'photo_provider' in args:
        shared.save_setting('storage', 'photo_provider',
                            form.get('photo_provider'))
        photo_args = [arg for arg in args if arg.startswith('storage_photo_')]
        for arg in photo_args:
            shared.save_setting('storage', arg, form.get(arg, ''))
    shared.save_setting('storage', 'photo_proxied', form.get('photo_proxied'))
    shared.save_setting('storage', 'file_proxied', form.get('file_proxied'))
    dict = __handle_get_storage()
    dict['message'] = 'Your storage settings are saved.'
    return dict