diff options
author | MS <ms@taler.net> | 2020-07-22 14:53:45 +0200 |
---|---|---|
committer | MS <ms@taler.net> | 2020-07-22 14:53:45 +0200 |
commit | 2d97ecc2c1ac605ca49e8a866b309daaeb7a831c (patch) | |
tree | 173f7917c5d0af822d2d51ed491c3cf2d8eaf23f /talermerchantdemos/blog/templates | |
download | taler-merchant-demos-2d97ecc2c1ac605ca49e8a866b309daaeb7a831c.tar.gz taler-merchant-demos-2d97ecc2c1ac605ca49e8a866b309daaeb7a831c.tar.bz2 taler-merchant-demos-2d97ecc2c1ac605ca49e8a866b309daaeb7a831c.zip |
Installing the Blog
Diffstat (limited to 'talermerchantdemos/blog/templates')
-rw-r--r-- | talermerchantdemos/blog/templates/article_frame.html | 10 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/article_refunded.html | 6 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/base.html | 80 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/cc-payment.html | 5 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/confirm_refund.html | 19 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/error.html | 22 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/index.html | 40 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/javascript.html | 31 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/request_payment.html | 69 | ||||
-rw-r--r-- | talermerchantdemos/blog/templates/show_refund.html | 28 |
10 files changed, 310 insertions, 0 deletions
diff --git a/talermerchantdemos/blog/templates/article_frame.html b/talermerchantdemos/blog/templates/article_frame.html new file mode 100644 index 0000000..1efc0d1 --- /dev/null +++ b/talermerchantdemos/blog/templates/article_frame.html @@ -0,0 +1,10 @@ +{% extends "templates/base.html" %} +{% block main %} +{% include "articles/" + article_file %} + +<hr> +<p> + You don't like this article? <a href="{{ url_for('confirm_refund', order_id=order_id) }}">Get a refund</a> within + the first hour after buying it. +</p> +{% endblock main %} diff --git a/talermerchantdemos/blog/templates/article_refunded.html b/talermerchantdemos/blog/templates/article_refunded.html new file mode 100644 index 0000000..d6e49d7 --- /dev/null +++ b/talermerchantdemos/blog/templates/article_refunded.html @@ -0,0 +1,6 @@ +{% extends "templates/base.html" %} +{% block main %} + <h1>Article refunded</h1> + Unfortunately you can't view the article {{ article_name }}, since the + payment for it was refunded. +{% endblock main %} diff --git a/talermerchantdemos/blog/templates/base.html b/talermerchantdemos/blog/templates/base.html new file mode 100644 index 0000000..52e97b7 --- /dev/null +++ b/talermerchantdemos/blog/templates/base.html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<!-- + This file is part of GNU TALER. + Copyright (C) 2014, 2015, 2016 INRIA + + 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 data-taler-nojs="true"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + {% block meta %}{% endblock %} + <title>Taler Essay Shop Demo</title> + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='web-common/pure.css') }}" /> + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='web-common/demo.css') }}" /> + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='web-common/taler-fallback.css') }}" id="taler-presence-stylesheet" /> + <style> + .warn { + background-color: #aa393977; + padding: 1em; + } + .notice { + border-radius: 1em; + background: #0333; + border-left: 0.3em solid #033; + padding-left: 1em; + padding-top: 0.5em; + padding-bottom: 0.5em; + margin-top: 2em; + margin-bottom: 2em; + } + #main a:link, #main a:visited, #main a:hover, #main a:active { + color: black; + } + </style> + {% block styles %}{% endblock %} + {% block scripts %}{% endblock %} +</head> + +<body> + <div class="demobar" style="display: flex; flex-direction: column;"> + <h1><span class="tt adorn-brackets">Taler Demo</span></h1> + <h1><span class="it"><a href="{{ env('TALER_ENV_URL_MERCHANT_BLOG') }}">Shop</a></span></h1> + <p>On this page you can buy articles using an imaginary currency (for now). + The articles are chapters from Richard Stallman's book "Free Software, Free Society", + which is also + <a href="http://shop.fsf.org/product/free-software-free-society-2/">published by the FSF</a> + and available gratis at <a href="http://www.gnu.org/">gnu.org</a>. + </p> + <ul> + <li><a href="{{ env('TALER_ENV_URL_INTRO', '#') }}">Introduction</a></li> + <li><a href="{{ env('TALER_ENV_URL_BANK', '#') }}">Bank</a></li> + <li><a href="{{ env('TALER_ENV_URL_MERCHANT_BLOG', '#') }}">Essay Shop</a></li> + <li><a href="{{ env('TALER_ENV_URL_MERCHANT_DONATIONS', '#') }}">Donations</a></li> + <li><a href="{{ env('TALER_ENV_URL_MERCHANT_SURVEY', '#') }}">Tipping/Survey</a></li> + <li><a href="{{ env('TALER_ENV_URL_BACKOFFICE', '#') }}">Back-office</a></li> + </ul> + <p>You can learn more about Taler on our main <a href="https://taler.net">website</a>.</p> + <div style="flex-grow:1"></div> + <p>Copyright © 2014—2018 Inria</p> + </div> + + <section id="main" class="content"> + {% block main %} + This is the main content of the page. + {% endblock %} + <hr /> + </section> +</body> +</html> diff --git a/talermerchantdemos/blog/templates/cc-payment.html b/talermerchantdemos/blog/templates/cc-payment.html new file mode 100644 index 0000000..b23b751 --- /dev/null +++ b/talermerchantdemos/blog/templates/cc-payment.html @@ -0,0 +1,5 @@ +{% extends "templates/base.html" %} + +{% block main %} +Credit card payment declined. +{% endblock main %} diff --git a/talermerchantdemos/blog/templates/confirm_refund.html b/talermerchantdemos/blog/templates/confirm_refund.html new file mode 100644 index 0000000..10aaa74 --- /dev/null +++ b/talermerchantdemos/blog/templates/confirm_refund.html @@ -0,0 +1,19 @@ +{% extends "templates/base.html" %} +{% block main %} + <h1>Refund Article?</h1> + + <p> + Do you want to get a refund for the article <em>{{ article_name }}</em>? After you've requested a refund, + you won't be able to read the article anymore. + </p> + + <p> + You will only be able to receive the refund on the same wallet that you've used to pay + for this article originally. + </p> + + <form action="{{ url_for('refund', order_id=order_id) }}" method="POST"> + <input type="text" name="article_name" value={{ article_name}} hidden> + <input type="submit" value="Request refund"> + </form> +{% endblock main %} diff --git a/talermerchantdemos/blog/templates/error.html b/talermerchantdemos/blog/templates/error.html new file mode 100644 index 0000000..0d4bd02 --- /dev/null +++ b/talermerchantdemos/blog/templates/error.html @@ -0,0 +1,22 @@ +{% extends "templates/base.html" %} +{% block main %} + <h1>An Error Occurred</h1> + + <p>{{ message }}</p> + + {% if status_code %} + <p>The backend returned status code {{ status_code }}.</p> + {% endif %} + + {% if json %} + <p>Backend Response:</p> + <pre>{{ json }}</pre> + {% endif %} + + {% if stack %} + <p>Stack trace:</p> + <pre> + {{ stack }} + </pre> + {% endif %} +{% endblock main %} diff --git a/talermerchantdemos/blog/templates/index.html b/talermerchantdemos/blog/templates/index.html new file mode 100644 index 0000000..0159779 --- /dev/null +++ b/talermerchantdemos/blog/templates/index.html @@ -0,0 +1,40 @@ +{% extends "templates/base.html" %} +{% block main %} + <h1>Essay Shop: Free Software, Free Society</h1> + <div style="font-size: smaller;"> + <p>This is the second edition of <cite>Free Software, Free Society: Selected Essays of Richard M. Stallman.</cite><br> + Free Software Foundation<br> + 51 Franklin Street, Fifth Floor<br> + Boston, MA 02110-1335 + <br> + Copyright © 2002, 2010 Free Software Foundation, Inc. + </p> + + <p>Verbatim copying and distribution of this entire book are permitted + worldwide, without royalty, in any medium, provided this notice is + preserved. Permission is granted to copy and distribute translations + of this book from the original English into another language provided + the translation has been approved by the Free Software Foundation and + the copyright notice and this permission notice are preserved on all + copies. + </p> + <p>ISBN 978-0-9831592-0-9</p> + </div> + + <h2>Chapters</h2> + <div> + Click on an individual chapter to to purchase it. You can + get free, virtual money to buy articles on this page at the <a href="{{ env('TALER_ENV_URL_BANK', '#') }}">bank</a>. + </div> + + <div> + {% for article in articles %} + <div class="notice"> + <h3><a href="{{ url_for('article', article_name=article.slug) }}">{{article.title}}</a></h3> + <p>{{ article.teaser|safe }} <a href="{{ url_for('article', article_name=article.slug) }}">(Pay to read more...)</a></p> + </div> + {% else %} + <em>(No articles available)</em> + {% endfor %} + </div> +{% endblock main %} diff --git a/talermerchantdemos/blog/templates/javascript.html b/talermerchantdemos/blog/templates/javascript.html new file mode 100644 index 0000000..436c186 --- /dev/null +++ b/talermerchantdemos/blog/templates/javascript.html @@ -0,0 +1,31 @@ +<!-- This file is in the public domain --> + +<html> + <head> + <title>JavaScript disclaimer.</title> + </head> + <body> + <h3>This site does not use JavaScript.</h3> + </body> +</html> + +<!-- The following lines are kept as a template for future inclusion of JavaScript files. --> + +<!-- + <html> + <body> + <table id="jslicense-labels1"> + <tr> + <td><a href="/static/path/to/example0.js">example0.js</a></td> + <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html">LGPL</a></td> + <td><a href="/static/path/to/example0.js.tar.gz">example0.js.tar.gz</a></td> + </tr> + <tr> + <td><a href="/static/path/to/example1.js">example1.js</a></td> + <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html">LGPL</a></td> + <td><a href="/static/path/to/example1.js.tar.gz">example1.js.tar.gz</a></td> + </tr> + </table> + </body> + </html> +--> diff --git a/talermerchantdemos/blog/templates/request_payment.html b/talermerchantdemos/blog/templates/request_payment.html new file mode 100644 index 0000000..6e050d0 --- /dev/null +++ b/talermerchantdemos/blog/templates/request_payment.html @@ -0,0 +1,69 @@ +{% extends "templates/base.html" %} + + +{% block meta %} +<noscript> + <meta http-equiv="refresh" content="1"> +</noscript> +{% endblock meta %} + + +{% block scripts %} +<script> + let checkUrl = decodeURIComponent("{{ check_status_url_enc }}"); + let delayMs = 500; + function check() { + let req = new XMLHttpRequest(); + req.onreadystatechange = function () { + if (req.readyState === XMLHttpRequest.DONE) { + if (req.status === 200) { + try { + let resp = JSON.parse(req.responseText); + if (resp.paid) { + document.location.reload(true); + } + } catch (e) { + console.error("could not parse response:", e); + } + } + setTimeout(check, delayMs); + } + }; + req.onerror = function () { + setTimeout(check, delayMs); + } + req.open("GET", checkUrl); + req.send(); + } + + setTimeout(check, delayMs); +</script> +{% endblock scripts %} + + +{% block main %} + +<h1>Payment Required</h1> + +<div class="taler-installed-hide"> + <p> + Looks like your browser doesn't support GNU Taler payments. You can try + installing a <a href="https://taler.net/en/wallet.html">wallet browser extension</a>. + </p> +</div> + +<div> + + <p> + You can use this QR code to pay with your mobile wallet: + </p> + + {{ qrcode_svg | safe }} + + <p> + Click <a href="{{ taler_pay_uri }}">this link</a> to open your system's Taler wallet if it exists. + </p> + +</div> + +{% endblock main %} diff --git a/talermerchantdemos/blog/templates/show_refund.html b/talermerchantdemos/blog/templates/show_refund.html new file mode 100644 index 0000000..913b6a5 --- /dev/null +++ b/talermerchantdemos/blog/templates/show_refund.html @@ -0,0 +1,28 @@ +{% extends "templates/base.html" %} + +{% block main %} + +<h1>Refund</h1> + +<div class="taler-installed-hide"> + <p> + Looks like your browser doesn't support GNU Taler payments. You can try + installing a <a href="https://taler.net/en/wallet.html">wallet browser extension</a>. + </p> +</div> + +<div> + + <p> + You can use this QR code to get a refund with your mobile wallet: + </p> + + {{ qrcode_svg | safe }} + + <p> + Click <a href="{{ taler_refund_uri }}">this link</a> to open your system's Taler wallet if it exists. + </p> + +</div> + +{% endblock main %} |