diff options
Diffstat (limited to 'youtube/templates')
-rw-r--r-- | youtube/templates/comments.html | 23 | ||||
-rw-r--r-- | youtube/templates/comments_page.html | 18 | ||||
-rw-r--r-- | youtube/templates/delete_comment.html | 26 | ||||
-rw-r--r-- | youtube/templates/post_comment.html | 30 |
4 files changed, 80 insertions, 17 deletions
diff --git a/youtube/templates/comments.html b/youtube/templates/comments.html index 901190f..82276b8 100644 --- a/youtube/templates/comments.html +++ b/youtube/templates/comments.html @@ -45,3 +45,26 @@ {% endif %} </section> {% endmacro %} + +{% macro comment_posting_box(info) %} + <form action="{{ info['form_action'] }}" method="post" class="comment-form"> + <div id="comment-account-options"> + <label for="account-selection">Account:</label> + <select id="account-selection" name="channel_id"> + {% for account in info['accounts'] %} + <option value="{{ account[0] }}">{{ account[1] }}</option> + {% endfor %} + </select> + <a href="/https://youtube.com/login" target="_blank">Add account</a> + </div> + <textarea name="comment_text"></textarea> + {% if info['include_video_id_input'] %} + <input type="hidden" name="video_id" value="{{ info['video_id'] }}"> + {% endif %} + <button type="submit" class="post-comment-button">{{ 'Post reply' if info['replying'] else 'Post comment' }}</button> + </form> +{% endmacro %} + + + + diff --git a/youtube/templates/comments_page.html b/youtube/templates/comments_page.html index 302fcac..c7947fa 100644 --- a/youtube/templates/comments_page.html +++ b/youtube/templates/comments_page.html @@ -42,23 +42,7 @@ </section> {% endif %} - - <form action="{{ form_action }}" method="post" class="comment-form"> - <div id="comment-account-options"> - <label for="account-selection">Account:</label> - <select id="account-selection" name="channel_id"> - {% for account in accounts %} - <option value="{{ account[0] }}">{{ account[1] }}</option> - {% endfor %} - </select> - <a href="/https://youtube.com/login" target="_blank">Add account</a> - </div> - <textarea name="comment_text"></textarea> - {% if include_video_id_input %} - <input type="hidden" name="video_id" value="{{ comments_info['video_id'] }}"> - {% endif %} - <button type="submit" class="post-comment-button">{{ 'Post reply' if comments_info['is_replies'] else 'Post comment' }}</button> - </form> + {{ comments.comment_posting_box(comment_posting_box_info) }} {% if not comments_info['is_replies'] %} <div class="comment-links"> diff --git a/youtube/templates/delete_comment.html b/youtube/templates/delete_comment.html new file mode 100644 index 0000000..4797240 --- /dev/null +++ b/youtube/templates/delete_comment.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} + +{% block page_title %}Delete comment?{% endblock %} + +{% block style %} + main{ + display: grid; + grid-template-columns: minmax(0px, 3fr) 640px 40px 500px minmax(0px,2fr); + align-content: start; + } + main > div, main > form{ + margin-top:20px; + grid-column:2; + } +{% endblock style %} + +{% block main %} + <div>Are you sure you want to delete this comment?</div> + <form action="" method="POST"> + {% for parameter_name, parameter_value in parameters %} + <input type="hidden" name="{{ parameter_name }}" value="{{ parameter_value }}"> + {% endfor %} + <input type="submit" value="Yes, delete it"> + </form> +{% endblock %} + diff --git a/youtube/templates/post_comment.html b/youtube/templates/post_comment.html new file mode 100644 index 0000000..98316ab --- /dev/null +++ b/youtube/templates/post_comment.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} +{% import "comments.html" as comments %} + +{% block page_title %}{{ 'Post reply' if replying else 'Post comment' }}{% endblock %} + +{% block style %} + main{ + display: grid; + grid-template-columns: 3fr 2fr; + } + .left{ + display:grid; + grid-template-columns: 1fr 640px; + } + textarea{ + width: 460px; + height: 85px; + } + .comment-form{ + grid-column:2; + justify-content:start; + } +{% endblock style %} + +{% block main %} + <div class="left"> + {{ comments.comment_posting_box(comment_posting_box_info) }} + </div> +{% endblock %} + |