2024-07-10 21:13:43 +02:00
{# Options:
teaser: Renders just a teaser
disable_voting: Disable voting buttons (to prevent mass downvoting)
no_collapse: Don't collapse for admin and moderator views
2024-12-05 13:11:40 +01:00
show_deleted: Show deleted content (for admin views)
children: replies to this reply
2024-07-10 21:13:43 +02:00
#}
2024-07-11 08:47:49 +02:00
{% if current_user.is_authenticated -%}
2024-10-19 16:09:01 +00:00
{% set collapsed = ((post_reply.score < = current_user.reply_collapse_threshold) or post_reply.deleted)
2024-07-11 08:47:49 +02:00
and not no_collapse -%}
{% else -%}
{% set collapsed = (post_reply.score < = -10) and not no_collapse -%}
{% endif -%}
2024-12-05 13:11:40 +01:00
< div class = "container comment{% if post_reply.score and post_reply.score <= -10 %} low_score{% endif %}{% if post_reply.author.id == post_reply.post.author.id %} original_poster{% endif %}" id = "comment_{{ post_reply.id }}" { % if post_reply . language_id and post_reply . language . code ! = ' en ' % } lang = "{{ post_reply.language.code }}" { % endif % } aria-level = "{{ post_reply.depth+1 }}" role = "treeitem" >
2024-07-10 21:13:43 +02:00
{% if not post_reply.author.indexable -%}<!-- googleoff: all --> {% endif -%}
{% if teaser -%}
< div class = "row" >
< div class = "col-12 hidable" >
2024-10-25 08:31:47 +00:00
{% if post_reply.post.deleted: -%}
reply to: [deleted post]
{% else -%}
reply to: < a href = "{{ url_for('activitypub.post_ap', post_id=post_reply.post.id, _anchor='comment_' + str(post_reply.id)) }}" > {{ post_reply.post.title | truncate(80, True) }}< / a >
{% endif -%}
2024-07-10 23:20:20 +02:00
< span class = "comment_community" > in {{ render_communityname(post_reply.post.community) }}< / span >
2024-07-10 21:13:43 +02:00
< / div >
< / div >
{% endif -%}
< div class = "row" >
< div class = "col-auto comment_author" >
2024-12-12 08:13:25 +13:00
< span class = "visually-hidden" > by< / span >
2024-07-10 21:13:43 +02:00
{{ render_username(post_reply.author) }}
{% if post_reply.author.id == post_reply.post.author.id -%}
< span title = "Submitter of original post" aria-label = "{{ _('Post creator') }}" class = "small" > [OP]< / span >
{% endif -%}
< / div >
2024-12-09 18:11:32 +13:00
< div class = "col-auto text-muted small pt-05" >
2024-12-23 12:39:22 +13:00
< time datetime = "{{ arrow.get(post_reply.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}" title = "{{ arrow.get(post_reply.posted_at).format('YYYY-MM-DD HH:mm:ss ZZ') }}" > {{ arrow.get(post_reply.posted_at).humanize(locale=locale) }}< / time > {% if post_reply.edited_at -%}, edited < time datetime = "{{ arrow.get(post_reply.posted_at) }}" title = "{{ arrow.get(post_reply.posted_at) }}" > {{ arrow.get(post_reply.edited_at).humanize(locale=locale) }}< / time > {% endif -%}
2024-07-10 21:13:43 +02:00
< / div >
< div class = "col-auto" >
{% if post_reply.reports and current_user.is_authenticated and post_reply.post.community.is_moderator(current_user) -%}
< span class = "red fe fe-report" title = "{{ _('Reported. Check comment for issues.') }}" > < / span >
{% endif -%}
< / div >
2024-10-19 16:09:01 +00:00
< div class = "col-auto" >
{% if post_reply.deleted -%}
< span class = "red fe fe-delete" title = "{{ _('Comment deleted') }}" > < / span >
{% endif -%}
< / div >
2024-07-10 21:13:43 +02:00
< div class = "col-auto" >
< a class = "unhide" href = "#" > < span class = "fe fe-expand" > < / span > < / a >
< / div >
< / div >
< div class = "row comment_body hidable{% if post_reply.reports and current_user.is_authenticated and post_reply.post.community.is_moderator(current_user) %} reported{% endif %}" >
< div class = "col-12" >
2024-12-05 13:11:40 +01:00
{% if post_reply.deleted and not show_deleted -%}
{% if post_reply.deleted_by is none or post_reply.deleted_by != post_reply.user_id -%}
< p > Deleted by moderator< / p >
{% else -%}
< p > Deleted by author< / p >
{% endif -%}
{% else -%}
{{ post_reply.body_html | community_links | safe }}
{% endif -%}
2024-07-10 21:13:43 +02:00
< / div >
< / div >
2024-10-20 11:23:20 +13:00
< div class = "comment_actions hidable" >
2024-12-09 14:05:09 +01:00
< div class = "post_replies_link" >
2024-07-10 21:13:43 +02:00
{% if post_reply.post.comments_enabled -%}
2024-10-25 08:31:47 +00:00
{% if not post_reply.post.deleted and not post_reply.deleted -%}
2024-12-09 14:05:09 +01:00
< a href = "{{ url_for('post.add_reply', post_id=post_reply.post.id, comment_id=post_reply.id) }}" rel = "nofollow noindex" > < span class = "fe fe-reply" > < / span > reply< / a >
2024-10-25 08:31:47 +00:00
{% else -%}
< span class = "fe fe-reply" > < / span > reply
{% endif -%}
2024-07-10 21:13:43 +02:00
{% endif -%}
2024-12-09 14:05:09 +01:00
< / div >
2024-10-20 11:23:20 +13:00
< div class = "voting_buttons_new" >
{% with comment=post_reply, community=post_reply.post.community -%}
{% include "post/_comment_voting_buttons.html" -%}
{% endwith -%}
2024-07-10 21:13:43 +02:00
< / div >
2024-10-20 11:23:20 +13:00
< div class = "hide_button" >
2024-07-10 21:13:43 +02:00
{% if collapsed -%}
< a href = '#' class = "" > < span class = "fe fe-expand" > < / span > < / a >
{% else -%}
< a href = '#' class = "" > < span class = "fe fe-collapse" > < / span > < / a >
{% endif -%}
< / div >
2024-10-20 11:23:20 +13:00
< div class = "notify_toggle" >
2024-12-05 13:11:40 +01:00
{% if current_user.is_authenticated and current_user.verified -%}
2024-07-11 08:47:49 +02:00
{% with comment=dict(comment=post_reply) -%}
{% include "post/_reply_notification_toggle.html" -%}
{% endwith -%}
{% endif -%}
2024-07-10 21:13:43 +02:00
< / div >
2024-12-09 14:05:09 +01:00
< div class = "comment_actions_link" >
{% if not post_reply.post.deleted -%}
2024-12-20 00:44:49 +07:00
< div class = "dropdown" >
< a
2024-12-22 15:11:42 +13:00
href="{{ url_for('post.post_reply_options', post_id=post_reply.post.id, comment_id=post_reply.id) if low_bandwidth else '#' }}"
2024-12-20 00:44:49 +07:00
data-bs-toggle="dropdown" rel="nofollow noindex"
aria-label="{{ _('Comment options') }}">
< span class = "fe fe-options" title = "Options" > < / span >
< / a >
2024-12-21 22:04:13 +07:00
< ul class = "dropdown-menu" style = "width: 320px" >
2024-12-20 00:44:49 +07:00
< div
hx-get="{{ url_for('post.post_reply_options', post_id=post_reply.post.id, comment_id=post_reply.id) }}"
2024-12-22 16:01:58 +13:00
hx-trigger="intersect once"
2024-12-20 00:44:49 +07:00
hx-target="this"
hx-swap="outerHTML"
>< / div >
< / ul >
< / div >
2024-12-09 14:05:09 +01:00
{% endif -%}
< / div >
2024-07-10 21:13:43 +02:00
< / div >
{% if not post_reply.author.indexable -%}<!-- googleon all --> {% endif -%}
2024-12-05 13:11:40 +01:00
{% if children -%}
< div class = "replies hidable" role = "group" >
{% if not THREAD_CUTOFF_DEPTH or post_reply.depth < = THREAD_CUTOFF_DEPTH -%}
{% for reply in children -%}
{% with post_reply=reply['comment'], children=reply['replies'] %}
{% include 'post/_post_reply_teaser.html' %}
{% endwith %}
{% endfor -%}
{% else -%}
< div class = "continue_thread hidable" >
< a href = "{{ url_for('post.continue_discussion', post_id=post_reply.post.id, comment_id=post_reply.id, _anchor='replies') }}" > Continue thread< / a >
< / div >
{% endif -%}
< / div >
{% endif -%}
2024-07-10 21:13:43 +02:00
{% if collapsed -%}
< script nonce = "{{ session['nonce'] }}" type = "text/javascript" >
if (typeof(toBeHidden) === 'undefined') {
toBeHidden = Array();
}
toBeHidden.push({{ post_reply.id }});
< / script >
{% endif -%}
2023-11-12 20:54:22 +13:00
< / div >