rDrama/files/templates/comments.html

858 lines
64 KiB
HTML

{%- import 'util/macros.html' as macros with context -%}
{% if not request.headers.get("xhr") %}
{% if focused_comment %}
<script defer src="{{'js/focused_comment.js' | asset}}"></script>
{% endif %}
{% if v %}
{% include "modals/award.html" %}
{% endif %}
{% include "popover.html" %}
{% endif %}
{% set disable_votes = (request.path.startswith('/@') and not wall and u != v) and v and v.admin_level < PERMS['ENABLE_VOTE_BUTTONS_ON_USER_PAGE'] %}
{% macro single_comment(c, level=1, collapse=False) %}
{% if can_see(v, c) %}
{% set ups=c.upvotes %}
{% set downs=c.downvotes %}
{% set score=ups-downs %}
{% if render_replies %}
{% set replies=c.replies(sort=sort) %}
{% endif %}
{% if (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id == c.author_id) %}
<div id="comment-{{c.id}}" class="comment {% if not (v and v.id == author_id) and not (v and v.admin_level) and not focused_comment %}collapsed{% endif %}">
<span class="comment-collapse-line" style="border-color: #{{c.author.switched.name_color}}" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
<div class="comment-body">
<div id="comment-{{c.id}}-only" class="comment-{{c.id}}-only">
<div class="user-info">
<span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
{% if standalone and c.nsfw %}<span class="badge badge-danger">NSFW</span> {% endif %}
{% if c.is_banned %}Removed by @{{c.ban_reason}} (site admin){% elif c.deleted_utc %}Deleted by author{% endif %}
</div>
</div>
{% if render_replies %}
<div id="replies-of-{{c.fullname}}">
{% if level<9 or request.path.startswith('/notifications') %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
{% elif replies %}
<button type="button" id="btn-{{c.id}}" class="d-mob-none btn btn-primary mt-3" data-nonce="{{g.nonce}}" data-onclick="more_comments('{{c.id}}', '{{sort}}')">More comments</button>
<a class="d-md-none py-3" href="{{c.more_comments}}">More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
{% endif %}
</div>
{% endif %}
</div>
</div>
{% else %}
{% set score=c.score %}
{% if v %}
{% set voted=c.voted %}
{% if not voted and v.id == c.author_id %}
{% set voted=1 %}
{% endif %}
{% else %}
{% set voted=-2 %}
{% endif %}
{% if standalone and level == 1 %}
<div id="post-info-{{c.id}}" class="{% if c.admin_note %}admin-note{% endif %} post-info mb-1 mr-2 {% if request.path.startswith('/notifications') %}mt-5{% elif request.path == '/search/messages' %}mt-6{% else %}mt-3{% endif %}">
{% if c.parent_post and c.post.nsfw %}
<span class="badge badge-danger text-small-extra mr-1">NSFW</span>
{% endif %}
<span class="align-top">
{% if c.parent_post %}
{% if request.path == '/notifications' and c.parent_post in v.subscribed_idlist %}
<span class="font-weight-bold">Subscribed Thread: <a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
{% else %}
<span class="font-weight-bold"><a {% if v and v.newtab %}data-target="t" target="_blank"{% endif %} href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
{% endif %}
{% if c.post.hole %}
<span class="ml-1"> in <a href="/h/{{c.post.hole}}" {% if v and v.newtab %}data-target="t" target="_blank"{% endif %}>/h/{{c.post.hole}}</a></span>
{% endif %}
{% elif c.author_id == AUTOJANNY_ID %}
<span class="font-weight-bold">Notification</span>
{% elif c.wall_user_id %}
{% if not wall %}
{% if c.wall_user_id == v.id %}
<span class="font-weight-bold"><a href="/@{{v.username}}">Your Profile Wall</a></span>
{% else %}
<span class="font-weight-bold"><a href="/@{{c.wall_user.username}}">@{{c.wall_user.username}}'s Profile Wall</a></span>
{% endif %}
{% endif %}
{% elif c.sentto == MODMAIL_ID %}
<span class="font-weight-bold">Sent to admins</span>
{% elif c.sentto == v.id %}
<span class="font-weight-bold">Sent to you</span>
{% else %}
<span class="font-weight-bold">Sent to <a href="/@{{c.senttouser.username}}">@{{c.senttouser.username}}</a></span>
{% endif %}
</span>
</div>
{% endif %}
{% if c.parent_comment and c.parent_comment.sentto %}
{% set isreply = True %}
{% else %}
{% set isreply = False %}
{% endif %}
<div id="comment-{{c.id}}" class="anchor comment {% if wall and level == 1 and not (focused_comment and c == focused_comment) %}mt-5{% elif wall %}mt-4{% elif standalone and level == 1 %}mt-0{% endif %} {% if collapse or c.collapse_for_user(v, focused_comment, request.full_path) %}collapsed{% endif %}" style="{% if isreply %}padding-left:0!important{% endif %}">
{% if not isreply %}
<span class="comment-collapse-line" style="border-color: {% if c.ghost %}var(--primary){% else %}#{{c.author.switched.name_color}}{% endif %}" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
{% endif %}
<div class="comment-body">
<div id="{% if focused_comment and focused_comment.id == c.id %}context{% else %}comment-{{c.id}}-only{% endif %}" class="{% if c.unread %}unread{% endif %} comment-{{c.id}}-only comment-anchor {% if focused_comment and focused_comment.id == c.id %}context{% endif %}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}">
<div class="user-info">
<span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
{% for a in c.awards %}
<span class="mr-1">
{% if a.kind in ["emoji","emoji-hz"] %}
<img class="emoji-award-icon" alt='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"' data-bs-toggle="tooltip" loading="lazy" src="{{SITE_FULL_IMAGES}}/e/{{a.note}}.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"'>
{% else %}
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}{% if a.kind in ["chud","namelock","flairlock"] %}: "{{a.note}}"{% endif %}'></i>
{% endif %}
</span>
{% endfor %}
{% if c.parent_post %}
{% set hole = c.post.hole %}
{% if hole and c.author.switched.exiler_username(hole) %}
<a><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /h/{{hole}} by @{{c.author.switched.exiler_username(hole)}}"></i></a>
{% endif %}
{% endif %}
{% if c.bannedfor %}
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this comment {{c.bannedfor}}"></i>
{% endif %}
{% if c.chuddedfor %}
<i class="fas fa-face-sleeping text-danger mr-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was chudded for this comment {{c.chuddedfor}}"></i>
{% endif %}
{% if c.active_reports(v) %}
<button type="button" class="btn btn-primary mx-1" style="padding:1px 5px; font-size:10px" data-toggleelement="#reports-{{c.id}}" data-toggleattr="d-none">{{c.active_reports(v)}} Report{{macros.plural(c.active_reports(v))}}</button>
{% endif %}
{% if c.nsfw %}
<span class="badge badge-danger text-small-extra mr-1">NSFW</span>
{% endif %}
{% with user = c.author %}
{%- include 'admin/shadowbanned_tooltip.html' -%}
{% endwith %}
{% if c.pinned == 'Admin Note' %}
<i id='pinned-{{c.id}}' class="fas fa-file-pen pr-1 text-admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.pinned}}"></i>
{% elif c.pinned %}
<i id='pinned-{{c.id}}' class="fas fa-thumbtack fa-rotate--45 pr-1 text-admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Pinned by @{{c.pinned}}" {% if c.pinned_utc %}data-onmouseover="pinned_timestamp('pinned-{{c.id}}')" data-timestamp={{c.pinned_utc}} data-nonce="{{g.nonce}}"{% endif %}></i>
{% endif %}
{% if c.distinguished and not c.ghost %}
<i class="fas fa-broom text-admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="
{%- if c.parent_post and c.author.switched.mods_hole(c.post.hole) -%}
/h/{{c.post.hole}} mod
{%- else -%}
{{SITE_NAME}} admin
{%- endif -%}
, speaking officially"></i>
{% endif %}
{% if c.is_op %}
<i class="fas fa-microphone-stand text-info" data-bs-toggle="tooltip" data-bs-placement="bottom" title="OP"></i>
{% endif %}
{% if c.is_bot %}
<i class="fas fa-robot text-info" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Bot"></i>
{% endif %}
{% if c.is_blocking and not c.ghost %}
<i class="fas fa-user-minus text-warning" data-bs-toggle="tooltip" data-bs-placement="bottom" title="You're blocking this user."></i>
{% endif %}
{% if c.is_blocked and not c.ghost %}
<i class="fas fa-user-minus text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="This user is blocking you."></i>
{% endif %}
{% if c.ghost %}
<span {% if c.distinguished %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %}>👻</span>
{% else %}
{% if FEATURES['PATRON_ICONS'] and c.author.switched.patron > 1 and c.author.switched.lifetimedonated_visible %}
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{c.author.switched.patron}}.webp?b=13" class="patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.switched.patron_tooltip}}" alt="{{c.author.switched.patron_tooltip}}">
{% endif %}
{% if FEATURES['HOUSES'] and c.author.switched.house %}
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/houses/{{c.author.switched.house}}.webp?x=8" class="house-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{c.author.switched.house}}" alt="House {{c.author.switched.house}}">
{% endif %}
{% if c.author.switched.verified %}<i class="fas fa-badge-check align-middle ml-1 {% if c.author.switched.verified=='Glowiefied' %}glow{% endif %}" style="color:{% if c.author.switched.verifiedcolor %}#{{c.author.switched.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.switched.verified}}"></i>
{% endif %}
<a class="user-name text-decoration-none {% if not c.author.switched.earlylife %}unbreakable{% endif %}" href="{{c.author.switched.url}}" data-pop-info='{{c.author.switched.json_popover(v) | tojson}}'' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="manual" data-content-id="popover" tabindex="0" style="color:#{{c.author.switched.name_color}}; font-size:12px; font-weight:bold">
<div class="profile-pic-30-wrapper">
<img loading="lazy" alt="@{{c.author.switched.username}}'s profile picture" src="{{c.author.switched.profile_url}}" class="profile-pic-30 mr-2">
{% if c.author.switched.hat_active(v)[0] -%}
<img class="profile-pic-30-hat hat" loading="lazy" src="{{c.author.switched.hat_active(v)[0]}}?x=8" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.switched.hat_active(v)[1]}}" alt="@{{c.author.switched.username}}'s hat">
{%- endif %}
</div>
<span {% if c.author.switched.patron and not c.distinguished %}class="patron" style="background-color:#{{c.author.switched.name_color}}"{% elif c.distinguished %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %} {% if c.author.switched.pride_username(v) %}pride_username{% endif %}>{{c.author_name}}</span>
</a>
{% if FEATURES['PRONOUNS'] %}
<span class="pronouns" style="color:#{{c.author.switched.flaircolor}} !important;border-color:#{{c.author.switched.flaircolor}} !important">{{c.author.switched.pronouns_display}}</span>
{% endif %}
{% if c.author.switched.flair_html %}
&nbsp;<bdi style="color: #{{c.author.switched.flaircolor}}">&nbsp;{{c.author.switched.flair_html | safe}}</bdi>
{% endif %}
{% endif %}
{% if c.parent_comment_id %}
<a href="
{%- if level == 1 and not request.path.startswith('/more_comments/') -%}
{{c.parent_comment.permalink}}
{%- else -%}
#comment-{{c.parent_comment_id}}-only
{%- endif -%}
" class="ml-2 {% if not c.parent_comment.author.earlylife %}unbreakable{% endif %}">
<i class="fas fa-reply fa-sm fa-fw fa-flip-horizontal"></i>
<span {% if not c.ghost %}class="replying-to-{{c.parent_comment.author.switched.id}}"{% endif %}>
{{- c.parent_comment.author_name -}}
</span>
</a>
{% endif %}
{% if c.notif_utc %}
<span id="timestamp-{{c.id}}" data-nonce="{{g.nonce}}" data-onmouseover="timestamp(this, '{{c.notif_utc}}')" data-bs-toggle="tooltip" data-bs-placement="bottom" class="time-stamp d-inline-block">&nbsp;{{c.age_string}}</span>
{% elif c.created_utc %}
<span id="timestamp-{{c.id}}" data-nonce="{{g.nonce}}" data-onmouseover="timestamp(this, '{{c.created_utc}}')" data-bs-toggle="tooltip" data-bs-placement="bottom" class="time-stamp d-inline-block">&nbsp;{{c.age_string}}</span>
{% endif %}
<a class="vertical-align ml-1" href="{{c.permalink}}">#{{c.id}}</a>
{% if c.edited_utc and v and (v.id == c.author_id or v.admin_level >= PERMS['VIEW_VERSIONS']) %}
<a href="/versions/{{c.fullname}}" class="font-italic" data-nonce="{{g.nonce}}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-onmouseover="timestamp(this, '{{c.edited_utc}}')">
&nbsp; Edited <span id="comment-edited_string-{{c.id}}">{{c.edited_string}}</span>
</a>
{% else %}
<span class="{% if not c.edited_utc %}d-none{% endif %} font-italic" data-nonce="{{g.nonce}}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-onmouseover="timestamp(this, '{{c.edited_utc}}')">
&nbsp; Edited <span id="comment-edited_string-{{c.id}}">{{c.edited_string}}</span>
</span>
{% endif %}
{% if c.treasure_amount and c.treasure_amount != '0' %}
{% if c.treasure_amount.startswith('l') %}
<span class="d-inline-block">
<img class="treasure" loading="lazy" alt="treasure" src="{{SITE_FULL_IMAGES}}/i/treasure_tickets.webp" width="20" height="20">
<em>Found {{c.treasure_amount.replace('l', '')}} Lottershe Tickets!</em>
</span>
{% elif '-' in c.treasure_amount %}
<span class="d-inline-block">
<img class="treasure" loading="lazy" alt="treasure" src="{{SITE_FULL_IMAGES}}/i/treasure_mimic.webp" width="20" height="20">
<em>A Mimic Ate {{c.treasure_amount.replace('-', '')}} Coins!</em>
</span>
{% else %}
<span class="d-inline-block">
<img class="treasure" loading="lazy" alt="treasure" src="{{SITE_FULL_IMAGES}}/i/treasure_coins.webp" width="20" height="20">
<em>Found {{c.treasure_amount}} Coins!</em>
</span>
{% endif %}
{% endif %}
<em class="ml-2 {% if not c.ping_cost %}d-none{% endif %}">
spent <span id="comment-ping-cost-{{c.id}}">{{c.ping_cost|commas}}</span> currency on pings
</em>
{% if c.slots_result %}
<em class="ml-2">{{c.slots_result}}</em>
{% elif c.casino_game_id %}
{% set game_state = c.casino_game.game_state_json %}
<em class="ml-2">{{game_state['symbols'].replace(',','')}} {{game_state['text']}}</em>
{% endif %}
{% if c.blackjack_result %}
{{c.blackjack_html | safe}}
{% endif %}
<span id="children-count-{{c.id}}" class="vertical-align ml-1"></span>
</div>
{{macros.reports(c, 'comment')}}
{% if c.is_banned %}
<div id="comment-banned-warning" class="comment-text text-removed mb-0">Removed by @{{c.ban_reason}} (site admin)</div>
{% endif %}
{% set realbody = c.realbody(v) %}
{% set tilt = c.award_count('tilt', v) %}
<div id="comment-text-{{c.id}}" class="{{c.award_classes(v)}} comment-text mb-0 {% if c.author_id == ZOZBOT_ID %}zozbot{% endif %}" {% if tilt %}style="transform: rotate({{tilt}}deg); padding: {{tilt*4}}px min(10vw,{{tilt*10}}px)"{% endif %}>
{{realbody | safe}}
</div>
{% if c.parent_post or c.wall_user_id %}
{% if v and (v.id == c.author_id or v.admin_level >= PERMS['POST_COMMENT_EDITING']) %}
<div id="comment-edit-{{c.id}}" class="d-none comment-write collapsed child">
<input hidden name="formkey" value="{{v|formkey}}" class="notranslate" translate="no">
<textarea autocomplete="off" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}10000{% endif %}" data-preview="preview-edit-{{c.id}}" data-nonce="{{g.nonce}}" data-oninput="markdown(this);charLimit('comment-edit-body-{{c.id}}','charcount-edit-{{c.id}}');handle_disabled(this)" id="comment-edit-body-{{c.id}}" data-id="{{c.id}}" name="body" form="comment-edit-form-{{c.id}}" class="file-ta comment-box form-control rounded" placeholder="Add your comment..." rows="3">{{c.body}}</textarea>
<div class="text-small font-weight-bold mt-1" id="charcount-edit-{{c.id}}" style="right: 1rem; bottom: 0.5rem; z-index: 3"></div>
<div class="format-btns">
{{macros.emoji_btn('comment-edit-body-' ~ c.id)}}
{{macros.gif_btn('comment-edit-body-' ~ c.id)}}
{{macros.file_btn('file-edit-reply-' ~ c.id)}}
</div>
<a class="text-small mt-3 d-inline-block" href="/formatting" data-target="t" target="_blank">Formatting help</a>
<button type="button" id="edit-btn-{{c.id}}" form="comment-edit-form-{{c.id}}" class="btn btn-primary ml-2 fl-r commentmob handle_disabled" data-nonce="{{g.nonce}}" data-onclick="comment_edit('{{c.id}}')">Save Edit</button>
<button type="button" id="cancel-edit-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="toggleEdit('{{c.id}}');remove_dialog()" class="btn btn-link text-muted ml-auto fl-r commentmob">Cancel</button>
<span id="upload-prog-edit-{{c.fullname}}" class="d-none mt-1 mr-2 fl-r">
<progress max="100"></progress>
<span></span>
</span>
<div id="preview-edit-{{c.id}}" class="preview mb-3 mt-5"></div>
</div>
{% endif %}
{% if not c.ghost %}
{{c.author.switched.rendered_sig(v) | safe}}
{% endif %}
<div id="comment-{{c.id}}-actions" class="comment-actions{% if voted == 1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div class="d-md-none mt-1">
<div class="post-actions">
<ul class="list-inline text-right d-flex">
<li class="list-inline-item mr-auto">
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<button type="button" data-bs-toggle="modal" data-bs-target="#adminModal-{{c.id}}">
<i class="fas fa-broom"></i>
</button>
{% endif %}
</li>
{% if v and not c.deleted_utc %}
<button id="toggle-reply-{{c.fullname}}-mobile" type="button" class="list-inline-item mr-3 btn nobackground toggle-reply-mobile" data-nonce="{{g.nonce}}" data-onclick="toggleReplyBox(this, 'reply-to-{{c.fullname}}')"><i class="fas fa-reply"></i></button>
{% endif %}
<li class="list-inline-item">
<button type="button" data-bs-toggle="modal" data-bs-target="#actionsModal-{{c.id}}">
<i class="fas fa-ellipsis-h"></i>
</button>
</li>
{% if v %}
<li id="voting-{{c.id}}-mobile" class="voting list-inline-item d-md-none">
<span tabindex="0" data-nonce="{{g.nonce}}" data-onclick="vote('comment-mobile', '{{c.id}}', '1')" class="comment-mobile-{{c.id}}-up mx-0 pr-1 arrow-up upvote-button comment-{{c.id}}-up {% if voted == 1 %}active{% endif %} {% if disable_votes and voted != 1 %}disabled {% endif %}"></span>
<span class="comment-mobile-score-{{c.id}} score comment-score-{{c.id}} {% if voted == 1 %}score-up{% elif voted==-1 %}score-down{% endif %}{% if c.controversial %} controversial{% endif %}"{% if not c.is_banned %} data-bs-toggle="tooltip" data-bs-placement="top" title="+{{ups}} | -{{downs}}"{% endif %} style="cursor: default">{{score}}</span>
<span {% if DISABLE_DOWNVOTES %}style="display:none!important"{% endif %} tabindex="0" data-nonce="{{g.nonce}}" data-onclick="vote('comment-mobile', '{{c.id}}', '-1')" class="comment-mobile-{{c.id}}-down mx-0 pl-1 my-0 arrow-down downvote-button comment-{{c.id}}-down {% if voted==-1 %}active{% endif %} {% if disable_votes and voted != -1 %}disabled {% endif %}">
</span>
</li>
{% else %}
<li id="voting-{{c.id}}-mobile" class="voting list-inline-item d-md-none">
<a tabindex="0" class="arrow-{{c.id}}-mobile-up mx-0 pr-1 arrow-mobile-up" href="/login?redirect={{request.full_path | urlencode}}">
<i class="fas fa-arrow-alt-up mx-0"></i>
</a>
<span class="comment-mobile-score-{{c.id}} score{% if c.controversial %} controversial{% endif %}"{% if not c.is_banned %} data-bs-toggle="tooltip" data-bs-placement="top" title="+{{ups}} | -{{downs}}"{% endif %} style="cursor: default">{{score}}</span>
<a tabindex="0" class="arrow-{{c.id}}-mobile-down arrow-mobile-down mx-0 pl-1 my-0" href="/login?redirect={{request.full_path | urlencode}}">
<i class="fas fa-arrow-alt-down mx-0"></i>
</a>
</li>
{% endif %}
</ul>
</div>
</div>
<ul class="d-none d-md-flex list-inline text-right text-md-left"><li>
{% if v %}
<button type="button" tabindex="0" data-nonce="{{g.nonce}}" data-onclick="vote('comment', '{{c.id}}', '1')" class="comment-{{c.id}}-up btn caction py-0 m-0 px-3 nobackground arrow-up upvote-button mx-0 comment-{{c.id}}-up {% if voted == 1 %}active{% endif %} {% if disable_votes and voted != 1 %}disabled {% endif %}"></button>
{% else %}
<a type="button" tabindex="0" class="comment-{{c.id}}-up btn caction nobackground py-0 m-0 px-3 arrow-up" href="/login?redirect={{request.full_path | urlencode}}"></a>
{% endif %}
<span class="btn caction nobackground p-0 m-0" style="cursor: default">
<span data-bs-toggle="tooltip" data-bs-placement="top" title="+{{ups}} | -{{downs}}" class="comment-score-{{c.id}} score comment-score-{{c.id}} {% if voted == 1 %}score-up{% elif voted==-1 %}score-down{% endif %} {% if c.controversial %}controversial{% endif %}">{{score}}</span>
</span>
{% if v %}
<button type="button" {% if DISABLE_DOWNVOTES %}style="display:none!important"{% endif %} tabindex="0" data-nonce="{{g.nonce}}" data-onclick="vote('comment', '{{c.id}}', '-1')" class="comment-{{c.id}}-down btn caction py-0 m-0 px-3 nobackground arrow-down downvote-button comment-{{c.id}}-down {% if voted==-1 %}active{% endif %} {% if disable_votes and voted != -1 %}disabled {% endif %}"></button>
{% else %}
<a type="button" {% if DISABLE_DOWNVOTES %}style="display:none!important"{% endif %} tabindex="0" class="comment-{{c.id}}-down btn caction py-0 m-0 px-3 nobackground arrow-down" href="/login?redirect={{request.full_path | urlencode}}"></a>
{% endif %}
{% if v and (c.parent_post or c.wall_user_id) %}
{% if c.author_id == v.id or v.admin_level >= PERMS['POST_COMMENT_EDITING'] %}
<button type="button" class="btn caction py-0 nobackground px-1 text-muted" data-nonce="{{g.nonce}}" data-onclick="toggleEdit('{{c.id}}')"><i class="fas fa-edit fa-fw"></i>Edit</button>
{% elif c.body %}
<button type="button" class="btn caction py-0 nobackground px-1 text-muted" data-nonce="{{g.nonce}}" data-onclick="expandMarkdown('{{c.fullname}}')"><i class="fas text-expand-icon-{{c.fullname}} fa-expand-alt"></i><span class="expand-text-{{c.fullname}}">View Source</span></button>
{% endif %}
{% endif %}
{% if v and (not c.ghost or v.admin_level >= PERMS['SEE_GHOST_VOTES']) %}
<a href="/votes/{{c.fullname}}" class="btn caction nobackground px-1 text-muted"><i class="fas fa-arrows-v"></i>Votes</a>
{% endif %}
<a class="btn caction nobackground px-1 text-muted" href="{{c.permalink}}"><i class="fas fa-book-open"></i>Context</a>
<button type="button" class="btn caction py-0 nobackground px-1 text-muted copy-link" data-clipboard-text="{% if SITE == 'rdrama.net' %}{{SITE_FULL}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy Link</button>
{% if v %}
{% if not c.deleted_utc %}
<button id="toggle-reply-{{c.fullname}}" type="button" class="btn caction py-0 nobackground px-1 text-muted" data-nonce="{{g.nonce}}" data-onclick="toggleReplyBox(this, 'reply-to-{{c.fullname}}')"><i class="fas fa-reply"></i>Reply</button>
{% endif %}
<button type="button" class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="modal" data-bs-target="#reportCommentModal" data-nonce="{{g.nonce}}" data-onclick="report_commentModal('{{c.id}}','{{c.author_name}}',)"><i class="fas fa-flag fa-fw"></i>Report</button>
{% if FEATURES['AWARDS'] -%}
<button type="button" class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" data-immune="{{c.author.switched.immune_to_negative_awards(v)}}" data-ghost="{{c.ghost}}" data-nonce="{{g.nonce}}"><i class="fas fa-gift"></i>Give Award</button>
{%- endif %}
<button type="button" id="save-{{c.id}}" class="btn caction py-0 nobackground px-1 {% if c.id not in v.saved_comment_idlist %}d-md-inline-block{% endif %} text-muted d-none" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/save_comment/{{c.id}}','save-{{c.id}}','unsave-{{c.id}}','d-md-inline-block')"><i class="fas fa-save"></i>Save {% if c.num_savers %}<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="Number of users who saved this comment">[{{c.num_savers}}]</span>{% endif %}</button>
<button type="button" id="unsave-{{c.id}}" class="btn caction py-0 nobackground px-1 {% if c.id in v.saved_comment_idlist %}d-md-inline-block{% endif %} text-muted d-none" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unsave_comment/{{c.id}}','save-{{c.id}}','unsave-{{c.id}}','d-md-inline-block')"><i class="fas fa-save"></i>Unsave {% if c.num_savers %}<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="Number of users who saved this comment">[{{c.num_savers}}]</span>{% endif %}</button>
{% endif %}
{% if v and (c.parent_post or c.wall_user_id) %}
{% if c.author_id == v.id %}
<button type="button" id="delete-{{c.id}}" class="btn caction py-0 nobackground px-1 text-muted {% if c.deleted_utc %}d-none{% endif %}" data-bs-toggle="modal" data-bs-target="#deleteCommentModal" data-nonce="{{g.nonce}}" data-onclick="delete_commentModal('{{c.id}}')"><i class="fas fa-trash-alt fa-fw"></i>Delete</button>
<button type="button" id="undelete-{{c.id}}" class="btn caction py-0 nobackground px-1 text-muted {% if not c.deleted_utc %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/undelete/comment/{{c.id}}','delete-{{c.id}}','undelete-{{c.id}}','d-none')" data-toggleelement=".comment-{{c.id}}-only" data-toggleattr="deleted"><i class="fas fa-trash-alt fa-fw"></i>Undelete</button>
{% endif %}
{% endif %}
{% if v %}
<button type="button" style="margin-top:0.2rem" class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="dropdown"><i class="fas fa-ellipsis-h fa-fw"></i></button>
<ul class="dropdown-menu">
{% if v.admin_level >= PERMS['APPS_MODERATION'] and c.oauth_app %}
<a href="{{c.oauth_app.permalink}}/comments" class="dropdown-item list-inline-item d-mob-none text-primary"><i class="fas fa-code text-primary fa-fw"></i>API App</a>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] or (c.parent_post and v.mods_hole(c.post.hole)) %}
<button type="button" id="distinguish-{{c.id}}" class="dropdown-item list-inline-item d-none {% if not c.distinguished %}d-md-block{% endif %} text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish-{{c.id}}','undistinguish-{{c.id}}','d-md-block')"><i class="fas fa-id-badge text-info fa-fw"></i>Distinguish</button>
<button type="button" id="undistinguish-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.distinguished %}d-md-block{% endif %} text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish-{{c.id}}','undistinguish-{{c.id}}','d-md-block')"><i class="fas fa-id-badge text-info fa-fw"></i>Undistinguish</button>
{% endif %}
{% if c.parent_post %}
{% set url = "" %}
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
{% set url = "pin_comment_admin" %}
{% elif v.id == c.post.author_id %}
{% set url = "pin_comment_op" %}
{% elif v.mods_hole(c.post.hole) %}
{% set url = "pin_comment_mod" %}
{% endif %}
{% if url != "" %}
<button type="button" id="pin-{{c.id}}" class="dropdown-item list-inline-item {% if not c.pinned %}d-md-block{% endif %} text-muted d-none text-info" data-bs-dismiss="modal" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/{{url}}/{{c.id}}','pin-{{c.id}}','unpin-{{c.id}}','d-md-block')"><i class="fas fa-thumbtack fa-rotate--45 text-info fa-fw"></i>Pin</button>
<button type="button" id="unpin-{{c.id}}" class="dropdown-item list-inline-item {% if c.pinned %}d-md-block{% endif %} text-muted d-none text-info" data-bs-dismiss="modal" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/un{{url}}/{{c.id}}','pin-{{c.id}}','unpin-{{c.id}}','d-md-block')"><i class="fas fa-thumbtack fa-rotate--45 text-info fa-fw"></i>Unpin</button>
{% endif %}
{% endif %}
{% if v.id != c.author_id and not c.ghost %}
<button type="button" id="block-{{c.id}}" class="dropdown-item list-inline-item text-danger {% if c.is_blocking %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/block_user?username={{c.author_name}}','block-{{c.id}}','unblock-{{c.id}}','d-none')"><i class="fas fa-eye-slash text-danger"></i>Block user</button>
<button type="button" id="unblock-{{c.id}}" class="dropdown-item text-success list-inline-item {% if not c.is_blocking %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unblock_user?username={{c.author_name}}','block-{{c.id}}','unblock-{{c.id}}','d-none')"><i class="fas fa-eye text-success"></i>Unblock user</button>
{% if (c.is_notif and c.author_id != AUTOJANNY_ID) or request.path == '/notifications/messages' %}
<button type="button" id="mute-notifs-{{c.id}}" class="dropdown-item text-danger list-inline-item {% if v.has_muted(c.author) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/mute_notifs/{{c.author.switched.id}}','mute-notifs-{{c.id}}','unmute-notifs-{{c.id}}','d-none')"><i class="fas fa-bell-slash text-danger"></i>Mute notifications from user</button>
<button type="button" id="unmute-notifs-{{c.id}}" class="dropdown-item text-success list-inline-item {% if not v.has_muted(c.author) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmute_notifs/{{c.author.switched.id}}','mute-notifs-{{c.id}}','unmute-notifs-{{c.id}}','d-none')"><i class="fas fa-bell text-success mr-25"></i>Unmute notifications from user</button>
{% endif %}
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<button type="button" id="remove-{{c.id}}" class="dropdown-item list-inline-item d-none {% if not c.is_banned %}d-md-block{% endif %} text-danger" data-nonce="{{g.nonce}}" data-onclick="removeComment(this,'{{c.id}}','approve-{{c.id}}','remove-{{c.id}}','d-md-block')"><i class="fas fa-ban text-danger fa-fw"></i>Remove</button>
<button type="button" id="approve-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.is_banned or request.path == '/admin/reported/comments' %}d-md-block{% endif %} text-success" data-nonce="{{g.nonce}}" data-onclick="approveComment(this,'{{c.id}}','approve-{{c.id}}','remove-{{c.id}}','d-md-block')"><i class="fas fa-check text-success fa-fw"></i>Approve</button>
{% endif %}
{% if c.parent_post %}
{% set hole = c.post.hole %}
{% if v.mods_hole(hole) and not c.author.switched.mods_hole(hole) %}
<button type="button" id="exile-{{c.id}}" class="d-none {% if not c.author.switched.exiler_username(hole) %}d-md-block{% endif %} dropdown-item list-inline-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/exile/comment/{{c.id}}','exile-{{c.id}}','unexile-{{c.id}}','d-none')"><i class="fas fa-campfire text-danger fa-fw"></i>Exile user</button>
<button type="button" id="unexile-{{c.id}}" class="d-none {% if c.author.switched.exiler_username(hole) %}d-md-block{% endif %} dropdown-item list-inline-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole}}/unexile/{{c.author_id}}','exile-{{c.id}}','unexile-{{c.id}}','d-none')"><i class="fas fa-campfire text-success fa-fw"></i>Unexile user</button>
{% endif %}
{% endif %}
{% if v.admin_level >= PERMS['PROGSTACK'] %}
<button type="button" id="progstack-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.is_approved != PROGSTACK_ID %}d-md-block{% endif %} text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/admin/progstack/comment/{{c.id}}','progstack-{{c.id}}','unprogstack-{{c.id}}','d-md-block')"><i class="fas fa-bullhorn text-danger fa-fw"></i>Apply Progressive Stack</button>
<button type="button" id="unprogstack-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.is_approved == PROGSTACK_ID %}d-md-block{% endif %} text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/admin/unprogstack/comment/{{c.id}}','progstack-{{c.id}}','unprogstack-{{c.id}}','d-md-block')"><i class="fas fa-bullhorn text-danger fa-fw"></i>Remove Progressive Stack</button>
{% endif %}
{% if FEATURES['NSFW_MARKING'] and (c.parent_post or c.wall_user_id) and (c.author_id == v.id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or v.mods_hole(c.post.hole)) or c.wall_user_id == v.id %}
<button type="button" id="mark-{{c.id}}" class="dropdown-item list-inline-item d-none {% if not c.nsfw %}d-md-block{% endif %} text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark-{{c.id}}','unmark-{{c.id}}','d-md-block')"><i class="fas fa-eye-evil text-danger fa-fw"></i>Mark NSFW</button>
<button type="button" id="unmark-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.nsfw %}d-md-block{% endif %} text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark-{{c.id}}','unmark-{{c.id}}','d-md-block')"><i class="fas fa-eye-evil text-success fa-fw"></i>Unmark NSFW</button>
{% endif %}
{% if v.admin_level >= PERMS['USER_BAN'] and v.id != c.author_id %}
<button type="button" class="{% if c.author.switched.is_permabanned %}d-none{% endif %} dropdown-item list-inline-item d-mob-none text-danger" data-bs-toggle="modal" data-bs-target="#banModal" data-nonce="{{g.nonce}}" data-onclick="punishModal(this, 'ban', '/comment/{{c.id}}', '{{c.author_name_punish_modal}}', '{{c.fullname}}')"><i class="fas fa-user-slash text-danger fa-fw"></i>Ban user</button>
<button type="button" id="unban-{{c.fullname}}" class="dropdown-item list-inline-item d-mob-none {% if not c.author.switched.is_suspended %}d-none{% endif %} text-success" data-nonce="{{g.nonce}}" data-onclick="unchud_or_unban(this,'/unban_user/{{c.fullname}}')"><i class="fas fa-user-slash text-success fa-fw"></i>Unban user</button>
{% endif %}
{% if v.admin_level >= PERMS['USER_CHUD'] and v.id != c.author_id %}
<button type="button" class="{% if c.author.switched.chud == 1 %}d-none{% endif %} dropdown-item list-inline-item d-mob-none text-danger" data-bs-toggle="modal" data-bs-target="#chudModal" data-nonce="{{g.nonce}}" data-onclick="punishModal(this, 'chud', '/comment/{{c.id}}', '{{c.author_name_punish_modal}}', '{{c.fullname}}')"><i class="fas fa-face-sleeping text-danger fa-fw"></i>Chud user</button>
<button type="button" id="unchud-{{c.fullname}}" class="dropdown-item list-inline-item d-mob-none {% if not c.author.switched.chud %}d-none{% endif %} text-success" data-nonce="{{g.nonce}}" data-onclick="unchud_or_unban(this,'/unchud_user/{{c.fullname}}')"><i class="fas fa-face-sleeping text-success fa-fw"></i>Unchud user</button>
{% endif %}
</ul>
{% endif %}
</li>
</ul>
</div>
{% endif %}
</div>
{% if v and v.id != c.author_id and c.body %}
<div autocomplete="off" class="markdown d-none border my-2 p-3 rounded" id="markdown-{{c.fullname}}" readonly>{{c.body.strip()}}</div>
{% endif %}
{% if c.parent_post or c.wall_user_id %}
{{macros.comment_reply_box(c.fullname, "reply-to-" + c.fullname, "d-none", "collapsed child", 'reply-to-' + c.fullname, true)}}
{% endif %}
{% if request.path.startswith('/transfers') %}
<a href="{{c.log_link}}"><i class="fas fa-link ml-1 text-muted"></i></a>
<button type="button" class="copy-link ml-3" data-clipboard-text="{{c.log_link}}"><i class="fas fa-copy text-muted"></i></button>
{% endif %}
{% if render_replies %}
<div id="replies-of-{{c.fullname}}">
{% if request.path.startswith('/notifications') and replies|length > 8 %}
{% for reply in replies %}
{% if reply.parent_post %}
{% set collapse = reply.collapse %}
{% else %}
{% set collapse = not reply.unread and loop.index != replies|length %}
{% endif %}
{{single_comment(reply, level=level+1, collapse=collapse)}}
{% endfor %}
{% elif request.path.startswith('/notifications') or level < 9 %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
{% elif replies %}
<button type="button" id="btn-{{c.id}}" class="d-mob-none btn btn-primary mt-3" data-nonce="{{g.nonce}}" data-onclick="more_comments('{{c.id}}', '{{sort}}')">More comments</button>
<a class="d-md-none py-3" href="{{c.more_comments}}">More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
{% endif %}
</div>
{% if (request.path.startswith('/notification') or request.path == '/search/messages') and c.level == 1 and c.sentto and not c.parent_post and c.author_id != AUTOJANNY_ID %}
<button id="toggle-reply-{{c.fullname}}" type="button" class="btn btn-primary nobackground mt-2" data-nonce="{{g.nonce}}" data-onclick="toggleReplyBox(this, 'reply-to-{{c.fullname}}')">Reply</button>
{% if c.sentto == MODMAIL_ID and v and v.id != c.author_id and v.admin_level >= PERMS['USER_BAN'] %}
<button type="button" class="btn btn-danger mt-2 ml-2 {% if c.author.switched.is_muted %}d-none{% endif %}" id="mute-user-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/mute_user/{{c.author.switched.id}}','mute-user-{{c.id}}','unmute-user-{{c.id}}','d-none')">Mute</button>
<button type="button" class="btn btn-primary mt-2 ml-2 {% if not c.author.switched.is_muted %}d-none{% endif %} btn-success" id="unmute-user-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmute_user/{{c.author.switched.id}}','mute-user-{{c.id}}','unmute-user-{{c.id}}','d-none')">Unmute</button>
{% endif %}
{% if c.author_id != v.id and request.path == '/notifications/messages' %}
<button type="button" id="mute-notifs-{{c.id}}" class="btn btn-danger nobackground ml-2 mt-2 {% if v.has_muted(c.author) %}d-none{% endif %}" data-areyousure="postToastSwitch(this,'/mute_notifs/{{c.author.switched.id}}','mute-notifs-{{c.id}}','unmute-notifs-{{c.id}}','d-none')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-dismiss="modal">Mute notifications from user</button>
<button type="button" id="unmute-notifs-{{c.id}}" data-bs-dismiss="modal" class="btn btn-success nobackground ml-2 mt-2 {% if not v.has_muted(c.author) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmute_notifs/{{c.author.switched.id}}','mute-notifs-{{c.id}}','unmute-notifs-{{c.id}}','d-none')">Unmute notifications from user</button>
{% endif %}
<div id="reply-to-{{c.fullname}}" class="d-none">
<div id="comment-form-space-{{c.id}}" class="comment-write collapsed child">
<div class="input-group">
<input hidden name="formkey" value="{{v|formkey}}" class="notranslate" translate="no">
<textarea data-fullname="{{c.fullname}}" required autocomplete="off" minlength="1" maxlength="10000" name="body" form="reply-to-c_{{c.id}}" data-id="{{c.id}}" class="file-ta comment-box form-control rounded" id="reply-form-body-{{c.id}}" rows="3" data-preview="message-reply-{{c.id}}" data-nonce="{{g.nonce}}" data-oninput="markdown(this);handle_disabled(this)"></textarea>
<div class="format-btns">
{{macros.emoji_btn('reply-form-body-' ~ c.id)}}
{{macros.gif_btn('reply-form-body-' ~ c.id)}}
{{macros.file_btn('file-upload-reply-' ~ c.fullname, not get_setting('dm_media'))}}
</div>
<div class="ml-auto">
<span id="upload-prog-{{c.fullname}}" class="d-none mt-1 mr-2">
<progress max="100"></progress>
<span></span>
</span>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="cancel('{{c.fullname}}')" class="btn btn-link text-muted ml-auto">Cancel</button>
<button type="button" id="save-reply-to-{{c.id}}" class="btn btn-primary ml-2 handle_disabled disabled" disabled data-nonce="{{g.nonce}}" data-onclick="post_reply('{{c.id}}')">Reply</button>
</div>
</div>
<div id="message-reply-{{c.id}}" class="preview mt-2"></div>
</div>
</div>
{% endif %}
{% else %}
<div id="replies-of-{{c.fullname}}"></div>
{% endif %}
</div>
<div class="modal fade d-md-none" id="actionsModal-{{c.id}}" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title">More options</h6>
<button type="button" class="close" data-bs-dismiss="modal">
<span><i class="fas fa-times"></i></span>
</button>
</div>
<div class="modal-body">
<ul class="list-group comment-actions">
{% if c.author_id == v.id %}
<button type="button" data-bs-dismiss="modal" data-nonce="{{g.nonce}}" data-onclick="toggleEdit('{{c.id}}')" class="list-group-item"><i class="fas fa-edit mr-2"></i>Edit</button>
{% else %}
{% if c.body %}
<button type="button" data-bs-dismiss="modal" data-nonce="{{g.nonce}}" data-onclick="expandMarkdown('{{c.fullname}}')" class="list-group-item"><i class="fas text-expand-icon-{{c.fullname}} fa-expand-alt mr-2"></i><span class="expand-text-{{c.fullname}}">View Source</span></button>
{% endif %}
{% endif %}
{% if v and (not c.ghost or v.admin_level >= PERMS['SEE_GHOST_VOTES']) %}
<a href="/votes/{{c.fullname}}"><li class="list-group-item"><i class="fas fa-arrows-v mr-2"></i>Votes</li></a>
{% endif %}
<a class="list-group-item" href="{{c.permalink}}"><i class="fas fa-book-open mr-2"></i>Context</a>
<button type="button" class="list-group-item copy-link" data-bs-dismiss="modal" data-clipboard-text="{% if SITE == 'rdrama.net' %}{{SITE_FULL}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy mr-2"></i>Copy Link</button>
{% if v %}
<button type="button" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportCommentModal" data-nonce="{{g.nonce}}" data-onclick="report_commentModal('{{c.id}}','{{c.author_name}}')" class="list-group-item"><i class="fas fa-flag mr-2"></i>Report</button>
{% if FEATURES['AWARDS'] -%}
<button type="button" class="list-group-item" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" data-immune="{{c.author.switched.immune_to_negative_awards(v)}}" data-ghost="{{c.ghost}}" data-nonce="{{g.nonce}}"><i class="fas fa-gift mr-2"></i>Give Award</button>
{%- endif %}
<button type="button" id="save2-{{c.id}}" class="list-group-item {% if c.id in v.saved_comment_idlist %}d-none{% endif %}" data-bs-dismiss="modal" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/save_comment/{{c.id}}','save2-{{c.id}}','unsave2-{{c.id}}','d-none')"><i class="fas fa-save mr-2"></i>Save {% if c.num_savers %}<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="Number of users who saved this comment">[{{c.num_savers}}]</span>{% endif %}</button>
<button type="button" id="unsave2-{{c.id}}" class="list-group-item {% if c.id not in v.saved_comment_idlist %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unsave_comment/{{c.id}}','save2-{{c.id}}','unsave2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-save mr-2"></i>Unsave {% if c.num_savers %}<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="Number of users who saved this comment">[{{c.num_savers}}]</span>{% endif %}</button>
{% if c.author_id == v.id %}
<button type="button" id="delete2-{{c.id}}" class="{% if c.deleted_utc %}d-none{% endif %} list-group-item text-danger" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#deleteCommentModal" data-nonce="{{g.nonce}}" data-onclick="delete_commentModal('{{c.id}}')"><i class="fas fa-trash-alt text-danger mr-2"></i>Delete</button>
<button type="button" id="undelete2-{{c.id}}" class="{% if not c.deleted_utc %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/undelete/comment/{{c.id}}', 'delete2-{{c.id}}', 'undelete2-{{c.id}}','d-none')" data-toggleelement=".comment-{{c.id}}-only" data-toggleattr="deleted" data-bs-dismiss="modal"><i class="fas fa-trash-alt text-success mr-2"></i>Undelete</button>
{% else %}
{% if not c.ghost %}
<button type="button" id="block2-{{c.id}}" class="{% if c.is_blocking %}d-none{% endif %} list-group-item text-danger" data-areyousure="postToastSwitch(this,'/block_user?username={{c.author_name}}','block2-{{c.id}}','unblock2-{{c.id}}','d-none')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-dismiss="modal"><i class="fas fa-eye-slash fa-fw text-danger mr-2"></i>Block user</button>
<button type="button" id="unblock2-{{c.id}}" data-bs-dismiss="modal" class="text-success list-group-item {% if not c.is_blocking %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unblock_user?username={{c.author_name}}','block2-{{c.id}}','unblock2-{{c.id}}','d-none')"><i class="fas fa-eye text-success mr-2"></i>Unblock user</button>
{% if c.is_notif and c.author_id != AUTOJANNY_ID %}
<button type="button" id="mute-notifs2-{{c.id}}" class="{% if v.has_muted(c.author) %}d-none{% endif %} list-group-item text-danger" data-areyousure="postToastSwitch(this,'/mute_notifs/{{c.author.switched.id}}','mute-notifs2-{{c.id}}','unmute-notifs2-{{c.id}}','d-none')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-dismiss="modal"><i class="fas fa-bell-slash fa-fw text-danger mr-2"></i>Mute notifications from user</button>
<button type="button" id="unmute-notifs2-{{c.id}}" data-bs-dismiss="modal" class="text-success list-group-item {% if not v.has_muted(c.author) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmute_notifs/{{c.author.switched.id}}','mute-notifs2-{{c.id}}','unmute-notifs2-{{c.id}}','d-none')"><i class="fas fa-bell text-success mr-2"></i>Unmute notifications from user</button>
{% endif %}
{% endif %}
{% endif %}
{% if FEATURES['NSFW_MARKING'] and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and (c.author_id == v.id or v.mods_hole(c.post.hole)) or c.wall_user_id == v.id %}
<button type="button" id="mark2-{{c.id}}" class="{% if c.nsfw %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger mr-2"></i>Mark NSFW</button>
<button type="button" id="unmark2-{{c.id}}" class="{% if not c.nsfw %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-success mr-2"></i>Unmark NSFW</button>
{% endif %}
{% if v.admin_level < PERMS['POST_COMMENT_DISTINGUISH'] and v.mods_hole(c.post.hole) %}
<button type="button" id="distinguish2-{{c.id}}" class="list-group-item {% if c.distinguished %}d-none{% endif %} text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-id-badge text-info mr-2"></i>Distinguish</button>
<button type="button" id="undistinguish2-{{c.id}}" class="list-group-item {% if not c.distinguished %}d-none{% endif %} text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-id-badge text-info mr-2"></i>Undistinguish</button>
{% endif %}
{% if v.admin_level < PERMS['POST_COMMENT_MODERATION'] %}
{% if c.parent_post and v.id == c.post.author_id %}
<button type="button" id="pin2-{{c.id}}" class="list-group-item {% if c.pinned %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/pin_comment_op/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Pin</button>
<button type="button" id="unpin2-{{c.id}}" class="list-group-item {% if not c.pinned %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unpin_comment_op/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Unpin</button>
{% elif v.mods_hole(c.post.hole) %}
<button type="button" id="pin2-{{c.id}}" class="list-group-item {% if c.pinned %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/pin_comment_mod/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Pin</button>
<button type="button" id="unpin2-{{c.id}}" class="list-group-item {% if not c.pinned %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unpin_comment_mod/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Unpin</button>
{% endif %}
{% endif %}
{% if c.parent_post %}
{% set hole = c.post.hole %}
{% if v.mods_hole(hole) and not c.author.switched.mods_hole(hole) %}
<button type="button" data-bs-dismiss="modal" id="exile2-{{c.id}}" class="{% if c.author.switched.exiler_username(hole) %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/exile/comment/{{c.id}}','exile2-{{c.id}}','unexile2-{{c.id}}','d-none')"><i class="fas fa-campfire text-danger mr-2"></i>Exile user</button>
<button type="button" data-bs-dismiss="modal" id="unexile2-{{c.id}}" class="{% if not c.author.switched.exiler_username(hole) %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole}}/unexile/{{c.author_id}}','exile2-{{c.id}}','unexile2-{{c.id}}','d-none')"><i class="fas fa-campfire text-success mr-2"></i>Unexile user</button>
{% endif %}
{% endif %}
{% endif %}
</ul>
</div>
</div>
</div>
</div>
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<div class="modal fade d-md-none" id="adminModal-{{c.id}}" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title">Admin options</h6>
<button type="button" class="close" data-bs-dismiss="modal">
<span><i class="fas fa-times"></i></span>
</button>
</div>
<div class="modal-body">
<ul class="list-group comment-actions">
{% if c.parent_post or c.wall_user_id %}
{% if v.admin_level >= PERMS['APPS_MODERATION'] and c.oauth_app %}
<a href="{{c.oauth_app.permalink}}/comments" class="list-group-item text-info"><i class="fas fa-code text-info mr-2"></i>API App</a>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_EDITING'] %}
<button type="button" class="list-group-item text-muted" data-nonce="{{g.nonce}}" data-onclick="toggleEdit('{{c.id}}')" data-bs-dismiss="modal">
<i class="fas fa-edit text-muted mr-2"></i>Edit
</button>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] %}
<button type="button" id="distinguish2-{{c.id}}" class="list-group-item {% if c.distinguished %}d-none{% endif %} text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-id-badge text-info mr-2"></i>Distinguish</button>
<button type="button" id="undistinguish2-{{c.id}}" class="list-group-item {% if not c.distinguished %}d-none{% endif %} text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-id-badge text-info mr-2"></i>Undistinguish</button>
{% endif %}
{% if c.parent_post %}
<button type="button" id="pin2-{{c.id}}" class="list-group-item {% if c.pinned %}d-none{% endif %} text-info" data-bs-target="#adminModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/pin_comment_admin/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Pin</button>
<button type="button" id="unpin2-{{c.id}}" class="list-group-item {% if not c.pinned %}d-none{% endif %} text-info" data-bs-target="#adminModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unpin_comment_admin/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Unpin</button>
{% endif %}
{% if FEATURES['NSFW_MARKING'] %}
<button type="button" id="mark2-{{c.id}}" class="{% if c.nsfw %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger mr-2"></i>Mark NSFW</button>
<button type="button" id="unmark2-{{c.id}}" class="{% if not c.nsfw %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-success mr-2"></i>Unmark NSFW</button>
{% endif %}
{% endif %}
{% if v.admin_level >= PERMS['PROGSTACK'] %}
<button type="button" id="progstack2-{{c.id}}" class="{% if c.is_approved == PROGSTACK_ID %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/admin/progstack/comment/{{c.id}}','progstack2-{{c.id}}','unprogstack2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-bullhorn text-danger fa-fw mr-2"></i>Apply Progressive Stack</button>
<button type="button" id="unprogstack2-{{c.id}}" class="{% if c.is_approved != PROGSTACK_ID %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/admin/unprogstack/comment/{{c.id}}','progstack2-{{c.id}}','unprogstack2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-bullhorn text-danger fa-fw mr-2"></i>Remove Progressive Stack</button>
{% endif %}
{% if v.id != c.author_id and v.admin_level >= PERMS['USER_BAN'] %}
<button type="button" class="list-group-item text-danger {% if c.author.switched.is_permabanned %}d-none{% endif %}" data-bs-dismiss="modal" data-bs-toggle="modal" data-bs-target="#banModal" data-nonce="{{g.nonce}}" data-onclick="punishModal(this, 'ban', '/comment/{{c.id}}', '{{c.author_name_punish_modal}}', '{{c.fullname}}')"><i class="fas fa-user-slash text-danger fa-fw mr-2"></i>Ban user</button>
<button type="button" id="unban2-{{c.fullname}}" class="{% if not c.author.switched.is_suspended %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="unchud_or_unban(this,'/unban_user/{{c.fullname}}')" data-bs-dismiss="modal"><i class="fas fa-user-minus fa-fw text-success mr-2"></i>Unban user</button>
{% endif %}
{% if v.id != c.author_id and v.admin_level >= PERMS['USER_CHUD'] %}
<button type="button" class="list-group-item text-danger {% if c.author.switched.chud == 1 %}d-none{% endif %}" data-bs-dismiss="modal" data-bs-toggle="modal" data-bs-target="#chudModal" data-nonce="{{g.nonce}}" data-onclick="punishModal(this, 'chud', '/comment/{{c.id}}', '{{c.author_name_punish_modal}}', '{{c.fullname}}')"><i class="fas fa-face-sleeping text-danger fa-fw mr-2"></i>Chud user</button>
<button type="button" id="unchud2-{{c.fullname}}" class="{% if not c.author.switched.chud %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="unchud_or_unban(this,'/unchud_user/{{c.fullname}}')" data-bs-dismiss="modal"><i class="fas fa-face-sleeping fa-fw text-success mr-2"></i>Unchud user</button>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<button type="button" id="remove2-{{c.id}}" class="{% if c.is_banned %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="removeComment(this,'{{c.id}}','approve2-{{c.id}}','remove2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-ban text-danger mr-2"></i>Remove</button>
<button type="button" id="approve2-{{c.id}}" class="{% if not c.is_banned and request.path != '/admin/reported/comments' %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="approveComment(this,'{{c.id}}','approve2-{{c.id}}','remove2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-check text-success mr-2"></i>Approve</button>
{% endif %}
</ul>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endif %}
{% endif %}
{% endmacro %}
{% for comment in comments %}
{{single_comment(comment)}}
{% endfor %}
{% if not request.headers.get("xhr") %}
{% if v %}
{% include "modals/emoji.html" %}
{% include "modals/gif.html" %}
{% if v.admin_level >= PERMS['USER_BAN'] %}
{% include "modals/punish.html" %}
{% endif %}
<div class="modal fade" id="deleteCommentModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header d-none d-md-flex">
<h5 class="modal-title">Delete comment?</h5>
<button type="button" class="close" data-bs-dismiss="modal">
<span><i class="fas fa-times"></i></span>
</button>
</div>
<div class="modal-body text-center">
<div class="py-4">
<i class="fas fa-trash-alt text-muted d-mob-none" style="font-size: 3.5rem"></i>
</div>
<h4 class="d-md-none">Delete comment?</h4>
<p class="d-mob-none">Your comment will be deleted everywhere on {{SITE_NAME}}.</p>
<p class="text-muted d-md-none">Your comment will be deleted everywhere on {{SITE_NAME}}.</p>
<button type="button" id="deleteCommentButton" class="btn btn-danger btn-block mt-5" data-bs-dismiss="modal">Delete comment</button>
<button type="button" class="btn btn-secondary btn-block" data-bs-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="reportCommentModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Report <span id="comment-author"></span>'s comment</h5>
<button type="button" class="close" data-bs-dismiss="modal">
<span><i class="fas fa-times"></i></span>
</button>
</div>
<div class="modal-body">
<h6>We're sorry something here is wrong.</h6>
<small class="form-text text-muted mb-1">Please enter a reason for reporting below.</small>
<input autocomplete="off" maxlength="100" id="reason_comment" class="allow-emojis form-control">
{{macros.emoji_btn('reason_comment', 'reportCommentModal')}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
<button type="button" id="reportCommentButton" class="btn btn-primary btn-danger" data-bs-dismiss="modal">Report comment</button>
</div>
</div>
</div>
</div>
{% endif %}
{% if v %}
<script defer src="{{'js/vendor/marked.js' | asset}}"></script>
<script defer src="{{'js/markdown.js' | asset}}"></script>
<script defer src="{{'js/comments_v.js' | asset}}"></script>
{% endif %}
<script defer src="{{'js/vendor/clipboard.js' | asset}}"></script>
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<script defer src="{{'js/admin/comments.js' | asset}}"></script>
{% endif %}
<script defer src="{{'js/comments+post_listing.js' | asset}}"></script>
<script defer src="{{'js/comments.js' | asset}}"></script>
<script defer src="{{'js/more_comments.js' | asset}}"></script>
<script defer src="{{'js/fix_collapse_lines.js' | asset}}"></script>
{% endif %}
{% if p %}
{% set pid = p.id %}
<input hidden id="comms" value="{% for c in p.comments %}{% if c.author_id != v.id and not c.voted %}{{c.id}}:{{c.created_utc}},{% endif %}{% endfor %}">
{% endif %}
{% if offset %}
<br>
<div id="view_more-{{offset}}">
<button type="button" id="viewbtn" class="btn btn-primary" data-nonce="{{g.nonce}}" data-ids="{{ids}}" data-onclick="view_more(this, {{pid}},'{{sort}}',{{offset}})">VIEW MORE COMMENTS</a>
</div>
{% endif %}
</body>