From a4e01da27c08e43a67b2618ad1e71c1f8f86d5cd Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Thu, 19 Sep 2024 15:33:11 +0530 Subject: youtube fronend --- youtube/templates/comments.html | 65 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 youtube/templates/comments.html (limited to 'youtube/templates/comments.html') diff --git a/youtube/templates/comments.html b/youtube/templates/comments.html new file mode 100644 index 0000000..7bd75e5 --- /dev/null +++ b/youtube/templates/comments.html @@ -0,0 +1,65 @@ +{% import "common_elements.html" as common_elements %} + +{% macro render_comment(comment, include_avatar, timestamp_links=False) %} +
+
+ + {% if include_avatar %} + {{ comment['author'] }} + {% endif %} + +
+ {{ comment['author'] }} +
+ + + {% if timestamp_links %} + {{ common_elements.text_runs(comment['text'])|timestamps|safe }} + {% else %} + {{ common_elements.text_runs(comment['text']) }} + {% endif %} + + {{ comment['likes_text'] if comment['approx_like_count'] else ''}} +
+ {% if comment['reply_count'] %} + {% if settings.use_comments_js and comment['replies_url'] %} +
+ {{ comment['view_replies_text'] }} + Open in new tab +
loading...
+
+ {% elif comment['replies_url'] %} + {{ comment['view_replies_text'] }} + {% else %} + {{ comment['view_replies_text'] }} (error constructing url) + {% endif %} + {% endif %} +
+
+
+{% endmacro %} + +{% macro video_comments(comments_info) %} + + {% if comments_info['error'] %} +
+
{{ comments_info['error'] }}
+
+ {% else %} +
+ {% for comment in comments_info['comments'] %} + {{ render_comment(comment, comments_info['include_avatars'], True) }} + {% endfor %} +
+ {% if 'more_comments_url' is in comments_info %} + More comments + {% endif %} + {% endif %} + +{% endmacro %} -- cgit v1.2.3-59-g8ed1b