diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-08-25 15:25:24 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-08-25 16:08:08 -0700 |
commit | e9b16ef71fc25f12e26da79392fa91ae30aabe5d (patch) | |
tree | 4052c356f3f1a2c18a75dbecd6405046024a00f8 /youtube/__init__.py | |
parent | 609244e34fed8cd2b27bddada266a3044709acf4 (diff) | |
download | yt-local-e9b16ef71fc25f12e26da79392fa91ae30aabe5d.tar.lz yt-local-e9b16ef71fc25f12e26da79392fa91ae30aabe5d.tar.xz yt-local-e9b16ef71fc25f12e26da79392fa91ae30aabe5d.zip |
Layout: Add themes
Diffstat (limited to 'youtube/__init__.py')
-rw-r--r-- | youtube/__init__.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/youtube/__init__.py b/youtube/__init__.py index ded6382..38ff7d3 100644 --- a/youtube/__init__.py +++ b/youtube/__init__.py @@ -1,7 +1,22 @@ import flask +import settings yt_app = flask.Flask(__name__) yt_app.url_map.strict_slashes = False @yt_app.route('/') def homepage(): return flask.render_template('home.html', title="Youtube local") + + +theme_names = { + 0: 'light_theme', + 1: 'gray_theme', + 2: 'dark_theme', +} + +@yt_app.context_processor +def inject_theme_preference(): + return { + 'theme_path': '/youtube.com/static/' + theme_names[settings.theme] + '.css', + } + |