summaryrefslogtreecommitdiff
path: root/talermerchantdemos/landing
diff options
context:
space:
mode:
Diffstat (limited to 'talermerchantdemos/landing')
-rw-r--r--talermerchantdemos/landing/landing.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/talermerchantdemos/landing/landing.py b/talermerchantdemos/landing/landing.py
index 270e205..3c1f304 100644
--- a/talermerchantdemos/landing/landing.py
+++ b/talermerchantdemos/landing/landing.py
@@ -82,13 +82,19 @@ def get_locale():
return lang
return "en"
-
##
# Make the environment available into templates.
#
# @return the environment-reading function.
@app.context_processor
def utility_processor():
+
+ def getactive():
+ return "landing"
+
+ def getlang():
+ return get_locale()
+
def env(name, default=None):
return os.environ.get(name, default)
@@ -101,7 +107,7 @@ def utility_processor():
# returns the YYYY-MM-DD date format.
return timestamp.strftime("%Y-%b-%d")
- return dict(env=env, prettydate=prettydate)
+ return dict(env=env, prettydate=prettydate, getactive=getactive, getlang=getlang)
##
@@ -116,7 +122,6 @@ def internal_error(e):
"landing-error.html.j2",
message=gettext("Internal error"),
stack=traceback.format_exc(),
- lang=get_locale(),
)
@@ -175,7 +180,6 @@ def start(lang):
return flask.render_template(
"landing-index.html.j2",
merchant_currency=CURRENCY,
- lang=lang,
bank_url=bank_register_url,
merchant_blog_url=merchant_blog_url,
merchant_donations_url=merchant_donations_url,
@@ -186,7 +190,7 @@ def start(lang):
@app.errorhandler(404)
def handler_404(e):
return flask.render_template(
- "landing-error.html.j2", message=gettext("Page not found"), lang=get_locale()
+ "landing-error.html.j2", message=gettext("Page not found")
)
@@ -195,5 +199,4 @@ def handler_405(e):
return flask.render_template(
"landing-error.html.j2",
message=gettext("HTTP method not allowed for this page"),
- lang=get_locale(),
)