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