improved theme system
This commit is contained in:
@ -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'
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
Reference in New Issue
Block a user