summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--talermerchantdemos/httpcommon/__init__.py6
-rw-r--r--talermerchantdemos/templates/common-base.html.j214
2 files changed, 12 insertions, 8 deletions
diff --git a/talermerchantdemos/httpcommon/__init__.py b/talermerchantdemos/httpcommon/__init__.py
index 785494b..c315929 100644
--- a/talermerchantdemos/httpcommon/__init__.py
+++ b/talermerchantdemos/httpcommon/__init__.py
@@ -152,7 +152,6 @@ all_languages = {
}
-
##
# Make the environment available into templates.
#
@@ -177,11 +176,16 @@ def make_utility_processor(pagename):
# returns the YYYY-MM-DD date format.
return timestamp.strftime("%Y-%b-%d")
+ def static(name):
+ return flask.url_for("static", filename=name)
+
return dict(
env=env,
prettydate=prettydate,
getactive=getactive,
getlang=getlang,
all_languages=all_languages,
+ static=static,
)
+
return utility_processor
diff --git a/talermerchantdemos/templates/common-base.html.j2 b/talermerchantdemos/templates/common-base.html.j2
index eb87739..a90c64c 100644
--- a/talermerchantdemos/templates/common-base.html.j2
+++ b/talermerchantdemos/templates/common-base.html.j2
@@ -18,18 +18,18 @@
<html>
<head>
<title>{{ page_title | default(gettext("GNU Taler Demo")) }}</title>
- <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='pure.css') }}" />
- <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='demo.css') }}" />
- <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='navbar.css') }}" />
- <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='torsten.css') }}" />
- {% block styles %}{% endblock %}
- {% block scripts %}{% endblock %}
+ <link rel="stylesheet" type="text/css" href="{{ static('pure.css') }}" />
+ <link rel="stylesheet" type="text/css" href="{{ static('demo.css') }}" />
+ <link rel="stylesheet" type="text/css" href="{{ static('navbar.css') }}" />
+ <link rel="stylesheet" type="text/css" href="{{ static('torsten.css') }}" />
+ {% block head %}
+ {% endblock %}
</head>
<body>
<header class="demobar" style="display: flex; flex-direction: column;">
<p>
- <img src="{{ url_for('static', filename='logo-white.svg') }}" height="100"><br/>
+ <img src="{{ static('logo-white.svg') }}" height="100"><br/>
</p>
<div>