summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-31 11:20:03 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-31 11:20:03 +0200
commitc231d555c8c41153e193325ae435d64531366982 (patch)
treeb00aed0d066af6594a0b4def8a671c45db9b078e
parent59f23403803f0fae7491b0d11c8bd7e06e7eae77 (diff)
downloadblog-c231d555c8c41153e193325ae435d64531366982.tar.gz
blog-c231d555c8c41153e193325ae435d64531366982.tar.bz2
blog-c231d555c8c41153e193325ae435d64531366982.zip
nicer refund UX
-rw-r--r--talerblog/blog/blog.py8
-rw-r--r--talerblog/blog/templates/article_frame.html6
2 files changed, 10 insertions, 4 deletions
diff --git a/talerblog/blog/blog.py b/talerblog/blog/blog.py
index 2cafd0d..fae9fea 100644
--- a/talerblog/blog/blog.py
+++ b/talerblog/blog/blog.py
@@ -183,6 +183,14 @@ except ImportError:
paid_articles_cache = SimpleCache()
+@app.route("/confirm-refund/<order_id>", methods=["GET"])
+def confirm_refund(order_id):
+ return flask.render_template(
+ "templates/confirm_refund.html",
+ article_name=article_name,
+ order_id=order_id)
+
+
##
# Triggers the refund by serving /refund/test?order_id=XY.
# Will be triggered by a "refund button".
diff --git a/talerblog/blog/templates/article_frame.html b/talerblog/blog/templates/article_frame.html
index 015c9d8..d5bd372 100644
--- a/talerblog/blog/templates/article_frame.html
+++ b/talerblog/blog/templates/article_frame.html
@@ -1,8 +1,6 @@
{% extends "templates/base.html" %}
{% block main %}
{% include "articles/" + article_file %}
- <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>
+ 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.
{% endblock main %}