From d26cc5b4b9e45d1797c9bd52f077d119077e7397 Mon Sep 17 00:00:00 2001 From: "max.mehl" Date: Wed, 19 May 2021 10:23:47 +0200 Subject: [PATCH] give more feedback on action --- autoreply_editor/main.py | 4 +++- autoreply_editor/templates/index.html | 26 ++++++++++++++++---------- autoreply_editor/templates/result.html | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 autoreply_editor/templates/result.html diff --git a/autoreply_editor/main.py b/autoreply_editor/main.py index 14e0205..d41cf36 100644 --- a/autoreply_editor/main.py +++ b/autoreply_editor/main.py @@ -20,4 +20,6 @@ def index_post(): if request.method == 'POST': with open(app.config.get("MESSAGE_FILE"), 'w') as f: f.write(str(input_message)) - return redirect("/") + result = "Success: The autoreply message has been updated!" + + return render_template("result.html", result=result) diff --git a/autoreply_editor/templates/index.html b/autoreply_editor/templates/index.html index 58e6f30..55f113f 100644 --- a/autoreply_editor/templates/index.html +++ b/autoreply_editor/templates/index.html @@ -1,13 +1,19 @@ - - Autoreply Editor - + + Autoreply Editor + - -
- -
- -
- + +

Autoreply Editor

+ +

+ Below you can see the current text of your autoreply message. You + can edit and update it directly below: +

+
+ +
+ +
+ diff --git a/autoreply_editor/templates/result.html b/autoreply_editor/templates/result.html new file mode 100644 index 0000000..84624af --- /dev/null +++ b/autoreply_editor/templates/result.html @@ -0,0 +1,14 @@ + + + Autoreply Editor + + + +

Autoreply Editor

+ +

{{ result }}

+ +

Go back

+ + +