diff --git a/i2p2www/__init__.py b/i2p2www/__init__.py index 1a42cc44b8cca50d5063ea971fee9d5edf7d066f..6c4dd504cbd1ed379e1c4ae79678edefbda70537 100644 --- a/i2p2www/__init__.py +++ b/i2p2www/__init__.py @@ -87,6 +87,11 @@ def detect_theme(): theme = request.cookies['style'] if 'theme' in request.args.keys(): 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)): theme = 'duck' g.theme = theme diff --git a/i2p2www/pages/global/layout.html b/i2p2www/pages/global/layout.html index 3d375aa3142f00e4d4fb8687d25c9f065c29b834..3f03fbd384ca88072453d0860608990c844a025e 100644 --- a/i2p2www/pages/global/layout.html +++ b/i2p2www/pages/global/layout.html @@ -5,7 +5,9 @@ <meta charset="UTF-8"> <title>{% block title_outer %}{% block title %}{% endblock %} - I2P{% endblock %}</title> <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 }}" /> + {%- endif %} <link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}" /> <meta name="robots" content="NOODP" /> {%- block headextra %}{% endblock %}