Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bewype/flask/controllers/themes.py
blob: 6782c2bb2e78b9bd56a4eb6e68c8ca9e8d0eb47a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# (C) Copyright 2010 Bewype <http://www.bewype.org>

# flask import
from flask import abort, url_for, redirect, session

# bewype import
from bewype.flask import app, render

# flask ext
from flaskext import themes


@app.route('/themes/')
def themes_list():
    _themes = themes.get_themes_list()
    return render('themes/list.html', themes=_themes)


@app.route('/themes/<identifier>')
def themes_save(identifier):
    if identifier not in app.theme_manager.themes:
        abort(404)
    session['theme'] = identifier
    return redirect(url_for('themes_list'))