diff options
author | Florian Dold <florian@dold.me> | 2021-04-21 21:07:18 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-04-21 21:07:18 +0200 |
commit | 2b84f3bd5de3a500b63193924bea2f3dfd0c9afd (patch) | |
tree | 08d5a2bd354ab7849d731eabe7b132429b6d2225 /talermerchantdemos/landing | |
parent | 4356540b2eb12b2c307270566b0b4ce969e12c60 (diff) | |
download | taler-merchant-demos-2b84f3bd5de3a500b63193924bea2f3dfd0c9afd.tar.gz taler-merchant-demos-2b84f3bd5de3a500b63193924bea2f3dfd0c9afd.tar.bz2 taler-merchant-demos-2b84f3bd5de3a500b63193924bea2f3dfd0c9afd.zip |
common base template, new logo and lots of cleanup
Diffstat (limited to 'talermerchantdemos/landing')
-rw-r--r-- | talermerchantdemos/landing/landing.py | 16 | ||||
l--------- | talermerchantdemos/landing/static | 1 | ||||
-rw-r--r-- | talermerchantdemos/landing/templates/base.html.j2 | 48 | ||||
-rw-r--r-- | talermerchantdemos/landing/templates/error.html.j2 | 13 | ||||
l--------- | talermerchantdemos/landing/templates/footer.html.j2 | 1 | ||||
-rw-r--r-- | talermerchantdemos/landing/templates/index.html.j2 | 89 | ||||
l--------- | talermerchantdemos/landing/templates/language-switcher.html.j2 | 1 | ||||
l--------- | talermerchantdemos/landing/templates/menu.html.j2 | 1 | ||||
l--------- | talermerchantdemos/landing/translations | 1 |
9 files changed, 8 insertions, 163 deletions
diff --git a/talermerchantdemos/landing/landing.py b/talermerchantdemos/landing/landing.py index ffbedd7..270e205 100644 --- a/talermerchantdemos/landing/landing.py +++ b/talermerchantdemos/landing/landing.py @@ -41,8 +41,7 @@ if not sys.version_info.major == 3 and sys.version_info.minor >= 6: ) sys.exit(1) -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -app = flask.Flask(__name__, template_folder=BASE_DIR) +app = flask.Flask(__name__, template_folder="../templates", static_folder="../static") app.debug = True app.secret_key = base64.b64encode(os.urandom(64)).decode("utf-8") @@ -56,6 +55,8 @@ except ConfigurationError as ce: print(ce) exit(1) +BABEL_TRANSLATION_DIRECTORIES = "../translations" + app.config.from_object(__name__) babel = Babel(app) @@ -67,8 +68,7 @@ LOGGER.info( "Operating with the following translations available: " + " ".join(translations) ) -# pylint: disable=no-member -app.jinja_env.globals.update(self_localized=self_localized) +app.add_template_global(self_localized) @babel.localeselector @@ -113,7 +113,7 @@ def utility_processor(): @app.errorhandler(Exception) def internal_error(e): return flask.render_template( - "templates/error.html.j2", + "landing-error.html.j2", message=gettext("Internal error"), stack=traceback.format_exc(), lang=get_locale(), @@ -173,7 +173,7 @@ def start(lang): merchant_survey_url = "#" return flask.render_template( - "templates/index.html.j2", + "landing-index.html.j2", merchant_currency=CURRENCY, lang=lang, bank_url=bank_register_url, @@ -186,14 +186,14 @@ def start(lang): @app.errorhandler(404) def handler_404(e): return flask.render_template( - "templates/error.html.j2", message=gettext("Page not found"), lang=get_locale() + "landing-error.html.j2", message=gettext("Page not found"), lang=get_locale() ) @app.errorhandler(405) def handler_405(e): return flask.render_template( - "templates/error.html.j2", + "landing-error.html.j2", message=gettext("HTTP method not allowed for this page"), lang=get_locale(), ) diff --git a/talermerchantdemos/landing/static b/talermerchantdemos/landing/static deleted file mode 120000 index d9bc54d..0000000 --- a/talermerchantdemos/landing/static +++ /dev/null @@ -1 +0,0 @@ -../static/
\ No newline at end of file diff --git a/talermerchantdemos/landing/templates/base.html.j2 b/talermerchantdemos/landing/templates/base.html.j2 deleted file mode 100644 index 97a91a5..0000000 --- a/talermerchantdemos/landing/templates/base.html.j2 +++ /dev/null @@ -1,48 +0,0 @@ -<!DOCTYPE html> -<!-- - This file is part of GNU TALER. - Copyright (C) 2014, 2015, 2016, 2020 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2.1, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> ---> - -<html> -<head> - <title>{{ gettext("GNU Taler Demo: Introduction") }}</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 %} -</head> - -<body> - <header class="demobar" style="display: flex; flex-direction: column;"> - <h1><img src="{{ url_for('static', filename='logo-white.svg') }}" height="100"><br/> - <span class="it"><a href="{{ env('TALER_ENV_URL_MERCHANT_SURVEY') }}">{{ gettext("Introduction") }}</a></span></h1> - <p>{{ - gettext("This is the GNU Taler demo.") + "<br>" + - gettext("Here you can try out the GNU Taler payment system using a toy currency.") - }} - </p> - </header> - {% from 'templates/menu.html.j2' import menu with context %} {{ menu('landing') }} - - <section id="main" class="content"> - {% block main %} - This is the main content of the page. - {% endblock %} - {% include 'templates/footer.html.j2' %} - </section> -</body> -</html> diff --git a/talermerchantdemos/landing/templates/error.html.j2 b/talermerchantdemos/landing/templates/error.html.j2 deleted file mode 100644 index 009947c..0000000 --- a/talermerchantdemos/landing/templates/error.html.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "templates/base.html.j2" %} -{% block main %} - <h1>{{ gettext("Error encountered") }}</h1> - - <p>{{ message }}</p> - - {% if stack %} - <p>{{gettext("Stack trace:")}}</p> - <pre> - {{ stack }} - </pre> - {% endif %} -{% endblock main %} diff --git a/talermerchantdemos/landing/templates/footer.html.j2 b/talermerchantdemos/landing/templates/footer.html.j2 deleted file mode 120000 index 028b093..0000000 --- a/talermerchantdemos/landing/templates/footer.html.j2 +++ /dev/null @@ -1 +0,0 @@ -../../templates/footer.html.j2
\ No newline at end of file diff --git a/talermerchantdemos/landing/templates/index.html.j2 b/talermerchantdemos/landing/templates/index.html.j2 deleted file mode 100644 index 9beb7c0..0000000 --- a/talermerchantdemos/landing/templates/index.html.j2 +++ /dev/null @@ -1,89 +0,0 @@ -{% extends "templates/base.html.j2" %} -{% block main %} - <article> - <h2>{{ gettext("Step 1: Install the Taler wallet") }}</h2> - <p> - {{ - gettext('Install the wallet from the <a href=\"{link}\">installation page</a>.').format(link="https://wallet.taler.net/") + "<br>" + - gettext('Installation only takes one click.') - }} - </p> - <p class="graybox"> - {{ gettext('After installation, you may be asked to grant the browser-based Taler wallet additional optional permissions that allow it to improve your user experience.') }} <br> - {{ gettext('These permissions will allow the wallet to automatically open if a page asks for a Taler payment.') }} <br> - {{ gettext('Regardless of the permissions you grant, the wallet will never transmit information about you or your browsing history to anyone.') }} - </p> - </article> - - <article> - <h2>{{ gettext("Step 2: Withdraw coins") }}</h2> - <p> - {{ - gettext('In this demo you are paying with {currency}, an imaginary currency.').format(currency=merchant_currency) + "<br>" + - gettext('To withdraw {currency} coins you must first create an account at our <a href="{bank}">bank</a>.').format(currency=merchant_currency,bank=bank_url) + "<br>" + - gettext('Signing up only requires you to pick a username and password.') + "<br>" + - gettext('When you create an account at our bank, you will be credited 100 {currency} for signing up.').format(currency=merchant_currency) + "<br>" + - gettext("Afterwards, use the bank's Web interface to authorize the transfer of {currency} to your wallet.").format(currency=merchant_currency) - }} - </p> - <p class="graybox"> - {{ gettext('Once you have completed this step, you can click on the Taler icon in your browser to check your balance.') }} - </p> - </article> - - <article> - <h2>{{ gettext("Step 3: Pay") }}</h2> - <p> - {{ - gettext("We have two demo merchants where you can spend your coins:") - }} - </p> - <ul> - <li> - {{ - gettext('At the <a href="{blog}">essay store</a> you can pay in {currency} for individual chapters of Richard Stallman's book "Free Software, Free Society".').format(blog=merchant_blog_url,currency=merchant_currency) + "<br>" + - gettext('The book is also available for free at <a href="{fsf}">the FSF</a>.').format(fsf="http://www.fsf.org/") - }} - </li> - <li> - {{ - gettext('At the project <a href="{donations}">donation website</a> you can show respect to a software project of your choice by donating {currency} to them.').format(donations=merchant_donations_url,currency=merchant_currency) - }} - </li> - </ul> - </article> - <article> - <h2>{{ gettext("Step 4: Check money flow") }}</h2> - <p> - {{ - gettext('You can see the wire transfers from the escrow account of the exchange to the merchants on the <a href="{bank}/public-accounts">public accounts page</a> of the bank.').format(bank=bank_url) + "<br>" + - gettext('Note that only accounts configured to be publicly viewable are shown on that page.') - }} - </p> - </article> - <article> - <h2>{{ gettext("Step 5: Survey") }}</h2> - <p> - {{ - gettext("Websites can give tips to visitors for completing tasks.") + "<br>" + - gettext('You can earn some {currency} coins by filling in our <a href="{url}">survey</a>.').format(url=merchant_survey_url,currency=merchant_currency) - }} - </p> - </article> - <!-- article> - <h2>Step 6: Are you a merchant? Taler has a build-in back-office!</h2> - <p> - If you are a merchant, you can check the <a href="{{ backoffice_url }}">back-office</a> - website to see how your Taler transactions got payed back by bank wire transfers. - </p> - </article --> - <article> - <h2>{{ gettext("Step 6: Reach out to us") }}</h2> - <p> - {{ - gettext("We appreciate feedback about Taler and this demonstrator.") + "<br>" + - gettext('Let us know what you think by <a href="{link}">contacting us</a>.').format(link="mailto:demo-feedback@taler.net") - }} - </p> - </article> -{% endblock %} diff --git a/talermerchantdemos/landing/templates/language-switcher.html.j2 b/talermerchantdemos/landing/templates/language-switcher.html.j2 deleted file mode 120000 index 6423c5c..0000000 --- a/talermerchantdemos/landing/templates/language-switcher.html.j2 +++ /dev/null @@ -1 +0,0 @@ -../../templates/language-switcher.html.j2
\ No newline at end of file diff --git a/talermerchantdemos/landing/templates/menu.html.j2 b/talermerchantdemos/landing/templates/menu.html.j2 deleted file mode 120000 index b9575ea..0000000 --- a/talermerchantdemos/landing/templates/menu.html.j2 +++ /dev/null @@ -1 +0,0 @@ -../../templates/menu.html.j2
\ No newline at end of file diff --git a/talermerchantdemos/landing/translations b/talermerchantdemos/landing/translations deleted file mode 120000 index 0a951f7..0000000 --- a/talermerchantdemos/landing/translations +++ /dev/null @@ -1 +0,0 @@ -../../translations/
\ No newline at end of file |