Exemple #1
0
def show_eric_options(req):
    """This renders the eric admin panel. Allow switching the skin and show
    the available skins.
    """
    new_skin = req.args.get('select')
    if new_skin in SKINS:
        try:
            req.app.cfg.change_single('eric_the_fish/skin', new_skin)
        except ConfigurationTransactionError, e:
            flash(_('The skin could not be changed.'), 'error')
        return redirect(url_for('eric_the_fish/config'))
Exemple #2
0
def view_ad_sense_config(req):
    client_code = req.args.get('client_code')
    banner_slot = req.args.get('banner_slot')
    width = req.args.get('width')
    height = req.args.get('height')
    if client_code and banner_slot and width and height:
        try:
            req.app.cfg.change_single('ad_sense/client_code', client_code)
            req.app.cfg.change_single('ad_sense/banner_slot', banner_slot)
            req.app.cfg.change_single('ad_sense/width', width)
            req.app.cfg.change_single('ad_sense/height', height)
            flash(_('Config updated!'), 'info')
        except ConfigurationTransactionError, e:
            flash(_('The code could not be changed.'), 'error')
        return redirect(url_for('ad_sense/config'))
Exemple #3
0
def view_ad_sense_config(req):
    client_code = req.args.get('client_code')
    banner_slot = req.args.get('banner_slot')
    width = req.args.get('width')
    height = req.args.get('height')
    if client_code and banner_slot and width and height:
        try:
            req.app.cfg.change_single('ad_sense/client_code', client_code)
            req.app.cfg.change_single('ad_sense/banner_slot', banner_slot)
            req.app.cfg.change_single('ad_sense/width', width)
            req.app.cfg.change_single('ad_sense/height', height)
            flash(_('Config updated!'), 'info')
        except ConfigurationTransactionError, e:
            flash(_('The code could not be changed.'), 'error')
        return redirect(url_for('ad_sense/config'))
Exemple #4
0
def handle_redirect(req):
    """Handles redirects from the redirect table."""
    new_url = lookup_redirect(req.path)
    if new_url is not None:
        return redirect(new_url, 301)
Exemple #5
0
def handle_redirect(req):
    """Handles redirects from the redirect table."""
    new_url = lookup_redirect(req.path)
    if new_url is not None:
        return redirect(new_url, 301)