From 2cdae42b91f0161d3bbec86b8aff01ab87629b5c Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 4 Jun 2009 09:43:41 +0000 Subject: [PATCH] improved theme system --- www.i2p2/app.py | 2 +- www.i2p2/pages/_layout.html | 6 +----- www.i2p2/pages/_layout_de.html | 6 +----- www.i2p2/static/styles/{default.css => light.css} | 0 4 files changed, 3 insertions(+), 11 deletions(-) rename www.i2p2/static/styles/{default.css => light.css} (100%) diff --git a/www.i2p2/app.py b/www.i2p2/app.py index f21b18b2..3002fa78 100644 --- a/www.i2p2/app.py +++ b/www.i2p2/app.py @@ -33,7 +33,7 @@ def app(environ, start_response): theme = req.cookies['style'] if 'theme' in req.args.keys(): theme = req.args['theme'] - if not theme in ['light', 'dark']: + if not os.path.isfile('static/styles/%s.css' % theme): theme = 'light' if path == '': path = 'index' diff --git a/www.i2p2/pages/_layout.html b/www.i2p2/pages/_layout.html index d1362a00..bcae26e2 100644 --- a/www.i2p2/pages/_layout.html +++ b/www.i2p2/pages/_layout.html @@ -5,11 +5,7 @@ {% filter capture('title') %}{% block title %}{% endblock %}{% endfilter %} - I2P - {% if theme == 'light' %} - - {% else %} - - {% endif %} + diff --git a/www.i2p2/pages/_layout_de.html b/www.i2p2/pages/_layout_de.html index 643cd0aa..3fc3726b 100644 --- a/www.i2p2/pages/_layout_de.html +++ b/www.i2p2/pages/_layout_de.html @@ -6,11 +6,7 @@ {% filter capture('title') %}{% block title %}{% endblock %}{% endfilter %} - I2P - {% if theme == 'light' %} - - {% else %} - - {% endif %} + diff --git a/www.i2p2/static/styles/default.css b/www.i2p2/static/styles/light.css similarity index 100% rename from www.i2p2/static/styles/default.css rename to www.i2p2/static/styles/light.css