From 2c71494d172ed40f69852e27b5ddc53e10947506 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 22 Apr 2021 15:03:30 +0200 Subject: use flask-agnostic helpers in base template --- talermerchantdemos/httpcommon/__init__.py | 6 +++++- talermerchantdemos/templates/common-base.html.j2 | 14 +++++++------- 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 @@ {{ page_title | default(gettext("GNU Taler Demo")) }} - - - - - {% block styles %}{% endblock %} - {% block scripts %}{% endblock %} + + + + + {% block head %} + {% endblock %}

-
+

-- cgit v1.2.3