improved theme system

This commit is contained in:
dev
2009-06-04 09:43:41 +00:00
parent 2bbb0f35d1
commit 2cdae42b91
4 changed files with 3 additions and 11 deletions

View File

@ -33,7 +33,7 @@ def app(environ, start_response):
theme = req.cookies['style'] theme = req.cookies['style']
if 'theme' in req.args.keys(): if 'theme' in req.args.keys():
theme = req.args['theme'] theme = req.args['theme']
if not theme in ['light', 'dark']: if not os.path.isfile('static/styles/%s.css' % theme):
theme = 'light' theme = 'light'
if path == '': if path == '':
path = 'index' path = 'index'

View File

@ -5,11 +5,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head>
<title>{% filter capture('title') %}{% block title %}{% endblock %}{% endfilter %} - I2P</title> <title>{% filter capture('title') %}{% block title %}{% endblock %}{% endfilter %} - I2P</title>
{% if theme == 'light' %} <link rel="stylesheet" href="_static/styles/{{ theme }}.css" type="text/css" title="{{ theme }}">
<link rel="stylesheet" href="_static/styles/default.css" type="text/css" title="Light">
{% else %}
<link rel="stylesheet" href="_static/styles/dark.css" type="text/css" title="Dark">
{% endif %}
<link rel="shortcut icon" href="_static/favicon.ico" /> <link rel="shortcut icon" href="_static/favicon.ico" />
</head> </head>
<body> <body>

View File

@ -6,11 +6,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head> <head>
<title>{% filter capture('title') %}{% block title %}{% endblock %}{% endfilter %} - I2P</title> <title>{% filter capture('title') %}{% block title %}{% endblock %}{% endfilter %} - I2P</title>
{% if theme == 'light' %} <link rel="stylesheet" href="_static/styles/{{ theme }}.css" type="text/css" title="{{ theme }}">
<link rel="stylesheet" href="_static/styles/default.css" type="text/css" title="Light">
{% else %}
<link rel="stylesheet" href="_static/styles/dark.css" type="text/css" title="Dark">
{% endif %}
<link rel="shortcut icon" href="_static/favicon.ico" /> <link rel="shortcut icon" href="_static/favicon.ico" />
</head> </head>
<body> <body>