give more feedback on action

This commit is contained in:
2021-05-19 10:23:47 +02:00
parent c1e64a8a17
commit d26cc5b4b9
3 changed files with 33 additions and 11 deletions

View File

@@ -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)

View File

@@ -1,13 +1,19 @@
<!DOCTYPE html>
<head>
<title>Autoreply Editor</title>
</head>
<head>
<title>Autoreply Editor</title>
</head>
<body>
<form action="" method="POST">
<textarea name="message" cols="70" rows="10">{{ message }}</textarea>
<br />
<input type="submit" value="Update">
</form>
</body>
<body>
<h1>Autoreply Editor</h1>
<p>
Below you can see the current text of your autoreply message. You
can edit and update it directly below:
</p>
<form action="" method="POST">
<textarea name="message" cols="120" rows="20">{{ message }}</textarea>
<br />
<input type="submit" value="Update">
</form>
</body>
</html>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<head>
<title>Autoreply Editor</title>
</head>
<body>
<h1>Autoreply Editor</h1>
<p>{{ result }}</p>
<p><a href="/">Go back</a></p>
</body>
</html>