aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-07-21 22:43:29 -0700
committerJames Taylor <user234683@users.noreply.github.com>2019-07-21 22:43:29 -0700
commitc5827a3bb1a6b2eb6cfbc7d9104bd73514311246 (patch)
tree14d8cc53f18ebfb8739a46d99817730da0bc7416
parent86382706fe87afc63b2757a1a133497c75ce3cd2 (diff)
downloadyt-local-c5827a3bb1a6b2eb6cfbc7d9104bd73514311246.tar.lz
yt-local-c5827a3bb1a6b2eb6cfbc7d9104bd73514311246.tar.xz
yt-local-c5827a3bb1a6b2eb6cfbc7d9104bd73514311246.zip
Add status template, use for comment deletion status
-rw-r--r--youtube/post_comment.py4
-rw-r--r--youtube/templates/status.html8
2 files changed, 10 insertions, 2 deletions
diff --git a/youtube/post_comment.py b/youtube/post_comment.py
index 26899c2..c4ffb9d 100644
--- a/youtube/post_comment.py
+++ b/youtube/post_comment.py
@@ -128,11 +128,11 @@ def delete_comment():
@yt_app.route('/comment_delete_success')
def comment_delete_success():
- return 'Successfully deleted comment'
+ return flask.render_template('status.html', title='Success', message='Successfully deleted comment')
@yt_app.route('/comment_delete_fail')
def comment_delete_fail():
- return 'Failed to delete comment'
+ return flask.render_template('status.html', title='Error', message='Failed to delete comment')
@yt_app.route('/post_comment', methods=['POST'])
@yt_app.route('/comments', methods=['POST'])
diff --git a/youtube/templates/status.html b/youtube/templates/status.html
new file mode 100644
index 0000000..1e18b5c
--- /dev/null
+++ b/youtube/templates/status.html
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+
+{% block page_title %}{{ title if (title is defined) else 'Status'}}{% endblock %}
+
+{% block main %}
+ {{ message }}
+{% endblock %}
+