aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/templates/comments.html
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-09-18 17:32:28 -0700
committerJames Taylor <user234683@users.noreply.github.com>2020-09-18 17:32:28 -0700
commit753f6c5389be82f4a17dafb1698e2f65388d35b6 (patch)
tree08593c8b283a9d10adf2c1c31e0954f5ac6232f1 /youtube/templates/comments.html
parente9989af03a0d6044106030f164f807cee42c1420 (diff)
downloadyt-local-753f6c5389be82f4a17dafb1698e2f65388d35b6.tar.lz
yt-local-753f6c5389be82f4a17dafb1698e2f65388d35b6.tar.xz
yt-local-753f6c5389be82f4a17dafb1698e2f65388d35b6.zip
Jump video to timestamp in description or comments
Diffstat (limited to 'youtube/templates/comments.html')
-rw-r--r--youtube/templates/comments.html10
1 files changed, 7 insertions, 3 deletions
diff --git a/youtube/templates/comments.html b/youtube/templates/comments.html
index 396852a..f2cdf65 100644
--- a/youtube/templates/comments.html
+++ b/youtube/templates/comments.html
@@ -1,6 +1,6 @@
{% import "common_elements.html" as common_elements %}
-{% macro render_comment(comment, include_avatar) %}
+{% macro render_comment(comment, include_avatar, timestamp_links=False) %}
<div class="comment-container">
<div class="comment">
<a class="author-avatar" href="{{ comment['author_url'] }}" title="{{ comment['author'] }}">
@@ -14,7 +14,11 @@
<a class="permalink" href="{{ comment['permalink'] }}" title="permalink">
<time datetime="">{{ comment['time_published'] }}</time>
</a>
- <span class="text">{{ common_elements.text_runs(comment['text']) }}</span>
+ {% if timestamp_links %}
+ <span class="text">{{ common_elements.text_runs(comment['text'])|timestamps|safe }}</span>
+ {% else %}
+ <span class="text">{{ common_elements.text_runs(comment['text']) }}</span>
+ {% endif %}
<span class="likes">{{ comment['likes_text'] if comment['like_count'] else ''}}</span>
<div class="bottom-row">
@@ -36,7 +40,7 @@
</div>
<div class="comments">
{% for comment in comments_info['comments'] %}
- {{ render_comment(comment, comments_info['include_avatars']) }}
+ {{ render_comment(comment, comments_info['include_avatars'], True) }}
{% endfor %}
</div>
{% if 'more_comments_url' is in comments_info %}