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']
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'

View File

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

View File

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