{% 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 %}