From aa06ddd3cf1de03922fc4e45e46ef3476a69e3f8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 11 Oct 2020 16:15:15 +0200 Subject: add i18n and new menu structure to donations page --- talermerchantdemos/donations/templates/base.html | 55 ---------- .../donations/templates/base.html.j2 | 115 +++++++++++++++++++++ .../donations/templates/checkout.html | 59 ----------- .../donations/templates/checkout.html.j2 | 46 +++++++++ talermerchantdemos/donations/templates/error.html | 22 ---- .../donations/templates/error.html.j2 | 24 +++++ .../donations/templates/fulfillment.html | 11 -- .../donations/templates/fulfillment.html.j2 | 22 ++++ talermerchantdemos/donations/templates/index.html | 42 -------- .../donations/templates/index.html.j2 | 44 ++++++++ .../templates/provider-not-supported.html | 6 -- .../templates/provider-not-supported.html.j2 | 6 ++ 12 files changed, 257 insertions(+), 195 deletions(-) delete mode 100644 talermerchantdemos/donations/templates/base.html create mode 100644 talermerchantdemos/donations/templates/base.html.j2 delete mode 100644 talermerchantdemos/donations/templates/checkout.html create mode 100644 talermerchantdemos/donations/templates/checkout.html.j2 delete mode 100644 talermerchantdemos/donations/templates/error.html create mode 100644 talermerchantdemos/donations/templates/error.html.j2 delete mode 100644 talermerchantdemos/donations/templates/fulfillment.html create mode 100644 talermerchantdemos/donations/templates/fulfillment.html.j2 delete mode 100644 talermerchantdemos/donations/templates/index.html create mode 100644 talermerchantdemos/donations/templates/index.html.j2 delete mode 100644 talermerchantdemos/donations/templates/provider-not-supported.html create mode 100644 talermerchantdemos/donations/templates/provider-not-supported.html.j2 (limited to 'talermerchantdemos/donations/templates') diff --git a/talermerchantdemos/donations/templates/base.html b/talermerchantdemos/donations/templates/base.html deleted file mode 100644 index 7456dca..0000000 --- a/talermerchantdemos/donations/templates/base.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - Taler Donation Demo - - - - {% block styles %}{% endblock %} - {% block scripts %}{% endblock %} - - - -
-

Taler Demo

-

Donations

-

This is the donation page, you can make donations (with an imaginary currency for now) to free software projects.

- -

You can learn more about Taler on our main website.

-
- -
- {% block main %} - This is the main content of the page. - {% endblock %} -
- -
- - diff --git a/talermerchantdemos/donations/templates/base.html.j2 b/talermerchantdemos/donations/templates/base.html.j2 new file mode 100644 index 0000000..b67658b --- /dev/null +++ b/talermerchantdemos/donations/templates/base.html.j2 @@ -0,0 +1,115 @@ + + + + + + {{ gettext("Taler Donation Demo") }} + + + + + + {% block styles %}{% endblock %} + {% block scripts %}{% endblock %} + + + +
+

{{ gettext("Taler Demo") }}

+

{{gettext("Donations")}}

+

{{ + gettext ("This is the donation page.") + "
" + + gettext ("Using this page you can make donations (in an imaginary currency) to Free Software projects.") + }} +

+
+ + + +
+ {% block main %} + This is the main content of the page. + {% endblock %} +
+
+

{{ gettext('You can learn more about Taler on our main website.').format(site="https://taler.net/") }}

+
+

Copyright © 2014—2020 Taler Systems SA

+
+
+ + diff --git a/talermerchantdemos/donations/templates/checkout.html b/talermerchantdemos/donations/templates/checkout.html deleted file mode 100644 index 5c3e116..0000000 --- a/talermerchantdemos/donations/templates/checkout.html +++ /dev/null @@ -1,59 +0,0 @@ -{% extends "templates/base.html" %} - -{% block main %} -
-

Select your payment method

- -

- This is an example for a "checkout" page of a Web shop. - On the previous page, you have created the shopping cart - and decided which product to buy (i.e. which project to - donate KUDOS to). Now in this page, you are asked to - select a payment option. As Taler is not yet universally - used, we expect merchants will offer various payment options. -

-

- The page also demonstrates how to only enable (or show) the Taler - option if Taler is actually supported by the browser. For example, - if you disable the Taler extension now, the Taler payment option - will be disabled in the page. Naturally, you could also trivially - hide the Taler option entirely by changing the visibility instead. -

-

- Note that you MUST select Taler here for the demo to continue, - as the other payment options are just placeholders and not - really working in the demonstration. Also, it is of course - possible to ask the user to make this choice already on the - previous page (with the shopping cart), we just separated the - two steps to keep each step as simple as possible. -

- -
-

- - - - - -
-
- -
- -{% endblock main %} diff --git a/talermerchantdemos/donations/templates/checkout.html.j2 b/talermerchantdemos/donations/templates/checkout.html.j2 new file mode 100644 index 0000000..5251fdf --- /dev/null +++ b/talermerchantdemos/donations/templates/checkout.html.j2 @@ -0,0 +1,46 @@ +{% extends "templates/base.html.j2" %} + +{% block main %} +
+

{{ gettext("Select your payment method") }}

+ +

+ {{ + gettext('This is an example for a "checkout" page of a Web shop. On the previous page, you have created the shopping cart and decided which product to buy (i.e. which project to donate KUDOS to). Now in this page, you are asked to select a payment option. As Taler is not yet universally used, we expect merchants will offer various payment options.') + }} +

+

+ {{ + gettext('Note that you MUST select Taler here for the demo to continue, as the other payment options are just placeholders and not really working in the demonstration. Also, it is of course possible to ask the user to make this choice already on the previous page (with the shopping cart), we just separated the two steps to keep each step as simple as possible.') + }} +

+ +
+

+ + + + + +
+
+ +
+ +{% endblock main %} diff --git a/talermerchantdemos/donations/templates/error.html b/talermerchantdemos/donations/templates/error.html deleted file mode 100644 index 0d4bd02..0000000 --- a/talermerchantdemos/donations/templates/error.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends "templates/base.html" %} -{% block main %} -

An Error Occurred

- -

{{ message }}

- - {% if status_code %} -

The backend returned status code {{ status_code }}.

- {% endif %} - - {% if json %} -

Backend Response:

-
{{ json }}
- {% endif %} - - {% if stack %} -

Stack trace:

-
-    {{ stack }}
-  
- {% endif %} -{% endblock main %} diff --git a/talermerchantdemos/donations/templates/error.html.j2 b/talermerchantdemos/donations/templates/error.html.j2 new file mode 100644 index 0000000..ffc2e1f --- /dev/null +++ b/talermerchantdemos/donations/templates/error.html.j2 @@ -0,0 +1,24 @@ +{% extends "templates/base.html.j2" %} +{% block main %} +

{{ gettext("Error encountered") }}

+ +

{{ message }}

+ + {% if status_code %} +

+ {{ gettext ("The backend returned status code {code}.").format(code=status_code) }}. +

+ {% endif %} + + {% if json %} +

{{gettext("Backend response:")}}

+
{{ json }}
+ {% endif %} + + {% if stack %} +

{{gettext("Stack trace:")}}

+
+    {{ stack }}
+  
+ {% endif %} +{% endblock main %} diff --git a/talermerchantdemos/donations/templates/fulfillment.html b/talermerchantdemos/donations/templates/fulfillment.html deleted file mode 100644 index 17d8cd8..0000000 --- a/talermerchantdemos/donations/templates/fulfillment.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "templates/base.html" %} - -{% block main %} -

Donation Receipt

-

Thank you, {{ donation_donor }}, for donating {{ donation_amount }} to {{ donation_receiver }}.

- -

Please keep the order identifier {{ order_id }} as a receipt for your donation. You can show other people that you donated -by sharing this link with them.

- -

You can always make another donation

-{% endblock main %} diff --git a/talermerchantdemos/donations/templates/fulfillment.html.j2 b/talermerchantdemos/donations/templates/fulfillment.html.j2 new file mode 100644 index 0000000..df9f30b --- /dev/null +++ b/talermerchantdemos/donations/templates/fulfillment.html.j2 @@ -0,0 +1,22 @@ +{% extends "templates/base.html.j2" %} + +{% block main %} +

{{ gettext("Donation Receipt") }}

+

+ {{ + gettext("Thank you, {donor}, for donating {amount} to {receiver}.").format(donor=donation_donor,amount=donation_amount,receiver=donation_receiver) + }} +

+

+ {{ + gettext("Please keep the order identifier {id} as a receipt for your donation.").format(id=order_id) + + gettext('You can show other people that you donated by sharing this link with them.').format(link=request.url) + }} +

+ +

+ {{ + gettext('You can always make another donation.').format(link=url_for('index')) + }} +

+{% endblock main %} diff --git a/talermerchantdemos/donations/templates/index.html b/talermerchantdemos/donations/templates/index.html deleted file mode 100644 index cbb3c35..0000000 --- a/talermerchantdemos/donations/templates/index.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends "templates/base.html" %} - -{% block main %} -

Welcome to the Taler Donation "Shop" Demo

- -

This toy donations website shows the user experience for donations with Taler. -You are paying with an imaginary currency ({{ merchant_currency }}). -

- -
-

Please select a project, the amount (*) of {{ merchant_currency }} you - wish to donate, and enter the name that will appear on your receipt:

- -
-
- - - - -
-
-

- (*) To make it a bit more fun, the 5 {{ merchant_currency }} option is - deliberately implemented with a fault: the merchant will try to make you - donate 6 {{ merchant_currency }} instead of the 5 {{ merchant_currency }} you - got to see. But do not worry, you will be given the opportunity to review - the final offer from the merchant in a window secured by the Taler - extension. That way, you can spot the error before committing to an - incorrect contract. -

-
- -{% endblock %} diff --git a/talermerchantdemos/donations/templates/index.html.j2 b/talermerchantdemos/donations/templates/index.html.j2 new file mode 100644 index 0000000..91122f3 --- /dev/null +++ b/talermerchantdemos/donations/templates/index.html.j2 @@ -0,0 +1,44 @@ +{% extends "templates/base.html.j2" %} + +{% block main %} +

{{ gettext("Taler donation demonstrator") }}

+ +

+{{ + gettext("This donations website shows the user experience for donations with Taler.") + "
" + + gettext("You can make donations in an toy currency ({currency})").format(currency=merchant_currency) +}} +

+ +
+

+ {{ + gettext("Please select a project, the amount (*) of {currency} you wish to donate, and enter the name that will appear on your receipt:").format(currency=merchant_currency) + }} +

+ +
+
+ + + + +
+
+

+ {{ + gettext("(*) To make it a bit more fun, the 5 {currency} option is deliberately implemented with a fault: the merchant will try to make you donate 6 {currency} instead of the 5 {currency} shown in the form. But do not worry, you will be given the opportunity to review the final offer from the merchant in a window secured by the Taler extension. That way, you can spot the error before committing to an incorrect contract or amount.").format(currency=merchant_currency) + }} +

+
+ +{% endblock %} diff --git a/talermerchantdemos/donations/templates/provider-not-supported.html b/talermerchantdemos/donations/templates/provider-not-supported.html deleted file mode 100644 index 88f2000..0000000 --- a/talermerchantdemos/donations/templates/provider-not-supported.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "templates/base.html" %} - -{% block main %} -

Payment Provider Not Supported

-

Unfortunately the selected payment provider is not supported in this demo. Please go back and select "Taler".

-{% endblock main %} diff --git a/talermerchantdemos/donations/templates/provider-not-supported.html.j2 b/talermerchantdemos/donations/templates/provider-not-supported.html.j2 new file mode 100644 index 0000000..88f2000 --- /dev/null +++ b/talermerchantdemos/donations/templates/provider-not-supported.html.j2 @@ -0,0 +1,6 @@ +{% extends "templates/base.html" %} + +{% block main %} +

Payment Provider Not Supported

+

Unfortunately the selected payment provider is not supported in this demo. Please go back and select "Taler".

+{% endblock main %} -- cgit v1.2.3