From 46dd63af682246c162423e37e0361e2d644c93e1 Mon Sep 17 00:00:00 2001
From: Christian Grothoff
Date: Mon, 12 Oct 2020 13:38:35 +0200
Subject: share menu and style sheets across demo pages (fixes #5704)
---
bin/taler-merchant-demos | 4 +-
setup.py | 4 +
talermerchantdemos/blog/templates/base.html.j2 | 72 +--
talermerchantdemos/blog/templates/footer.html.j2 | 1 +
.../blog/templates/language-switcher.html.j2 | 1 +
talermerchantdemos/blog/templates/menu.html.j2 | 1 +
.../donations/templates/base.html.j2 | 73 +--
.../donations/templates/footer.html.j2 | 1 +
.../donations/templates/language-switcher.html.j2 | 1 +
.../donations/templates/menu.html.j2 | 1 +
talermerchantdemos/landing/templates/base.html.j2 | 72 +--
.../landing/templates/footer.html.j2 | 1 +
talermerchantdemos/landing/templates/index.html.j2 | 2 +-
.../landing/templates/language-switcher.html.j2 | 1 +
talermerchantdemos/landing/templates/menu.html.j2 | 1 +
talermerchantdemos/survey/templates/base.html.j2 | 72 +--
talermerchantdemos/survey/templates/footer.html.j2 | 1 +
.../survey/templates/language-switcher.html.j2 | 1 +
talermerchantdemos/survey/templates/menu.html.j2 | 1 +
.../templates/language-switcher.html.j2 | 12 +
translations/de/LC_MESSAGES/messages.po | 571 +++++++++++++++------
translations/messages.pot | 357 +++++++------
22 files changed, 667 insertions(+), 584 deletions(-)
create mode 120000 talermerchantdemos/blog/templates/footer.html.j2
create mode 120000 talermerchantdemos/blog/templates/language-switcher.html.j2
create mode 120000 talermerchantdemos/blog/templates/menu.html.j2
create mode 120000 talermerchantdemos/donations/templates/footer.html.j2
create mode 120000 talermerchantdemos/donations/templates/language-switcher.html.j2
create mode 120000 talermerchantdemos/donations/templates/menu.html.j2
create mode 120000 talermerchantdemos/landing/templates/footer.html.j2
create mode 120000 talermerchantdemos/landing/templates/language-switcher.html.j2
create mode 120000 talermerchantdemos/landing/templates/menu.html.j2
create mode 120000 talermerchantdemos/survey/templates/footer.html.j2
create mode 120000 talermerchantdemos/survey/templates/language-switcher.html.j2
create mode 120000 talermerchantdemos/survey/templates/menu.html.j2
create mode 100644 talermerchantdemos/templates/language-switcher.html.j2
diff --git a/bin/taler-merchant-demos b/bin/taler-merchant-demos
index e7c3821..aa63c20 100755
--- a/bin/taler-merchant-demos
+++ b/bin/taler-merchant-demos
@@ -105,8 +105,8 @@ def handle_serve_from_config(config_obj, which_shop):
def demos(config, http_port, which_shop):
"""WHICH_SHOP is one of: blog, donations, survey or landing."""
- if which_shop not in ["blog", "donations", "survey"]:
- print("Please use a valid shop name: blog, donations, survey.")
+ if which_shop not in ["blog", "donations", "landing", "survey"]:
+ print("Please use a valid shop name: blog, donations, landing, survey.")
sys.exit(1)
config_obj = TalerConfig.from_file(config)
if http_port:
diff --git a/setup.py b/setup.py
index 5e8db52..fdd48db 100755
--- a/setup.py
+++ b/setup.py
@@ -20,21 +20,25 @@ setup(name='talermerchantdemos',
"static/*.svg",
# Landing files
"landing/templates/*.j2",
+ "landing/static/*.css",
"landing/translations/*/LC_MESSAGES/*.mo",
# Blog files
"blog/templates/*.html",
"blog/templates/*.j2",
"blog/static/favicon.ico",
+ "blog/static/*.css",
"blog/articles/*/*",
"blog/translations/*/LC_MESSAGES/*.mo",
"blog/data/*",
# Donation files
"donations/templates/*.j2",
+ "donations/static/*.css",
"donations/translations/*/LC_MESSAGES/*.mo",
# Survey files
"survey/templates/*.j2",
"survey/static/favicon.ico",
"survey/static/*.js",
+ "survey/static/*.css",
"survey/translations/*/LC_MESSAGES/*.mo",
]
},
diff --git a/talermerchantdemos/blog/templates/base.html.j2 b/talermerchantdemos/blog/templates/base.html.j2
index 65f8461..c4935f1 100644
--- a/talermerchantdemos/blog/templates/base.html.j2
+++ b/talermerchantdemos/blog/templates/base.html.j2
@@ -24,45 +24,7 @@
-
-
+
{% block styles %}{% endblock %}
{% block scripts %}{% endblock %}
@@ -78,41 +40,13 @@
}}
-
+ {% from 'templates/menu.html.j2' import menu with context %} {{ menu('blog') }}
{% block main %}
This is the main content of the page.
{% endblock %}
-
-
-
{{ gettext('You can learn more about GNU Taler on our main website .').format(site="https://taler.net/") }}
-
-
Copyright © 2014—2020 Taler Systems SA
-
+ {% include 'templates/footer.html.j2' %}