[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-merchant-demos] branch master updated: use flask-agnostic h
From: |
gnunet |
Subject: |
[taler-taler-merchant-demos] branch master updated: use flask-agnostic helpers in base template |
Date: |
Thu, 22 Apr 2021 15:03:36 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository taler-merchant-demos.
The following commit(s) were added to refs/heads/master by this push:
new 2c71494 use flask-agnostic helpers in base template
2c71494 is described below
commit 2c71494d172ed40f69852e27b5ddc53e10947506
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Apr 22 15:03:30 2021 +0200
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 @@
<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>
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taler-merchant-demos] branch master updated: use flask-agnostic helpers in base template,
gnunet <=