I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit e9e453a5 authored by str4d's avatar str4d
Browse files

Temporarily enable loading of an externally-hosted CSS file

parent 8fbf352b
No related branches found
No related tags found
No related merge requests found
...@@ -87,6 +87,11 @@ def detect_theme(): ...@@ -87,6 +87,11 @@ def detect_theme():
theme = request.cookies['style'] theme = request.cookies['style']
if 'theme' in request.args.keys(): if 'theme' in request.args.keys():
theme = request.args['theme'] theme = request.args['theme']
# TEMPORARY: enable external themes
# TODO: Remove this (and the corresponding lines in global/layout.html
if theme[:7] == 'http://':
g.exttheme = theme
theme = 'duck'
if not os.path.isfile(safe_join(safe_join(STATIC_DIR, 'styles'), '%s.css' % theme)): if not os.path.isfile(safe_join(safe_join(STATIC_DIR, 'styles'), '%s.css' % theme)):
theme = 'duck' theme = 'duck'
g.theme = theme g.theme = theme
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{% block title_outer %}{% block title %}{% endblock %} - I2P{% endblock %}</title> <title>{% block title_outer %}{% block title %}{% endblock %} - I2P{% endblock %}</title>
<link rel="canonical" href="{{ canonical() }}" /> <link rel="canonical" href="{{ canonical() }}" />
{% if g.exttheme %}<link rel="stylesheet" type="text/css" href="{{ g.exttheme }}" title="External theme" />{% else -%}
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles/' + g.theme + '.css') }}" title="{{ g.theme }}" /> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles/' + g.theme + '.css') }}" title="{{ g.theme }}" />
{%- endif %}
<link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}" /> <link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}" />
<meta name="robots" content="NOODP" /> <meta name="robots" content="NOODP" />
{%- block headextra %}{% endblock %} {%- block headextra %}{% endblock %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment