From c5827a3bb1a6b2eb6cfbc7d9104bd73514311246 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 21 Jul 2019 22:43:29 -0700 Subject: Add status template, use for comment deletion status --- youtube/post_comment.py | 4 ++-- youtube/templates/status.html | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 youtube/templates/status.html 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 %} + -- cgit v1.2.3