296 lines
9.8 KiB
HTML
296 lines
9.8 KiB
HTML
|
|
|
|
{% if v %}
|
|
{% include "award_modal.html" %}
|
|
<script defer src="/assets/js/comments_v.js?v=74"></script>
|
|
{% endif %}
|
|
|
|
{% if v and v.admin_level > 1 %}
|
|
<script defer src="/assets/js/comments_admin.js?v=54"></script>
|
|
{% endif %}
|
|
|
|
<script defer src="/assets/js/comments.js?v=5"></script>
|
|
|
|
|
|
{% macro single_comment(c, level=1) %}
|
|
|
|
{% set ups=c.upvotes %}
|
|
{% set downs=c.downvotes %}
|
|
{% set score=ups-downs %}
|
|
|
|
{% if v and (v.shadowbanned or v.admin_level > 1) %}
|
|
{% set replies=c.replies3 %}
|
|
{% else %}
|
|
{% set replies=c.replies %}
|
|
{% endif %}
|
|
|
|
{% if (c.is_banned or c.deleted_utc > 0 or c.is_blocking) and not (v and v.admin_level>0) and not (v and v.id==c.author_id) %}
|
|
|
|
<div id="comment-{{c.id}}" class="comment">
|
|
|
|
|
|
<span class="comment-collapse-desktop hidden d-md-block" style="border-left: 2px solid #{{c.author.namecolor}};" onclick="collapse_comment('{{c.id}}')"></span>
|
|
|
|
<div class="comment-body">
|
|
|
|
<div id="comment-{{c.id}}-only">
|
|
|
|
<div class="user-info">
|
|
<span class="comment-collapse-icon" onclick="collapse_comment('{{c.id}}')"></span>
|
|
{% if standalone and c.over_18 %}<span class="badge badge-red">+18</span>{% endif %}
|
|
{% if c.is_banned %}removed by @{{c.ban_reason}}{% elif c.deleted_utc > 0 %}Deleted by author{% elif c.is_blocking %}You are blocking @{{c.author.username}}{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
{% if render_replies %}
|
|
{% if level<5 %}
|
|
<div id="replies-of-{{c.id}}" class="">
|
|
{% set standalone=False %}
|
|
{% for reply in replies %}
|
|
{{single_comment(reply, level=level+1)}}
|
|
{% endfor %}
|
|
</div>
|
|
{% elif "notifications" in request.path %}
|
|
<div id="replies-of-{{c.id}}" class="hidden d-md-block">
|
|
{% set standalone=False %}
|
|
{% for reply in replies %}
|
|
{{single_comment(reply, level=level+1)}}
|
|
{% endfor %}
|
|
</div>
|
|
<div id="morecomment-{{c.id}}" class="md:hidden mt-2 more-comments text-small">
|
|
<a {% if v %}href="{{c.shortlink}}"{% else %}href="/logged_out{{c.shortlink}}"{% endif %}>More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
|
|
</div>
|
|
{% elif replies %}
|
|
<div id="morecomment-{{c.id}}" class="mt-2 more-comments text-small">
|
|
<a {% if v %}href="{{c.shortlink}}"{% else %}href="/logged_out{{c.shortlink}}"{% endif %}>More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{% else %}
|
|
|
|
{% set score=c.score %}
|
|
|
|
{% if v %}
|
|
{% set voted=c.voted %}
|
|
|
|
{% else %}
|
|
{% set voted=-2 %}
|
|
|
|
{% endif %}
|
|
|
|
{% if standalone and level==1 %}
|
|
<div class="post-info font-bold mt-5 mb-1">
|
|
{% if c.post and c.post.over_18 %}
|
|
<span class="badge badge-red">+18</span>
|
|
{% endif %}
|
|
<div>
|
|
{% if c.post %}
|
|
{% if c.author_id==v.id and c.child_comments and is_notification_page%}
|
|
<span>
|
|
Comment {{'Replies' if (c.child_comments | length)>1 else 'Reply'}}:
|
|
<a href="{{c.post.permalink}}" class="text-gray-700 hover:text-gray-900">{{c.post.realtitle(v) | safe}}</a>
|
|
</span>
|
|
{% elif c.post.author_id==v.id and c.level == 1 and is_notification_page%}
|
|
<span>Post Reply:
|
|
<a href="{{c.post.permalink}}" class="text-gray-700 hover:text-gray-900">{{c.post.realtitle(v) | safe}}</a>
|
|
</span>
|
|
{% elif is_notification_page and c.parent_submission in v.subscribed_idlist() %}
|
|
<span>Subscribed Thread:
|
|
<a href="{{c.post.permalink}}" class="text-gray-700 hover:text-gray-900">{{c.post.realtitle(v) | safe}}</a></span>
|
|
{% elif is_notification_page %}
|
|
<span>Username Mention:
|
|
<a href="{{c.post.permalink}}" class="text-gray-700 hover:text-gray-900">{{c.post.realtitle(v) | safe}}</a>
|
|
</span>
|
|
{% else %}
|
|
<span>
|
|
<a href="{{c.post.permalink}}" class="text-gray-700 hover:text-gray-900">{{c.post.realtitle(v) | safe}}</a>
|
|
</span>
|
|
{% endif %}
|
|
{% elif c.author_id==NOTIFICATIONS_ID or c.author_id==AUTOJANNY_ID %}
|
|
<span>{{'SITE_NAME' | app_config}} Notification</span>
|
|
{% else %}
|
|
{% if c.sentto == 0 %}
|
|
<span>Sent to admins</span>
|
|
{% else %}
|
|
<span>Sent to @{{c.senttouser.username}}</span>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div id="comment-{{c.id}}" class="anchor {% if c.unread %}unread{% endif %} relative flex mt-4 md:mt-6 {% if standalone and level==1 %} mt-0{% endif %}{% if c.collapse_for_user(v) or (standalone and c.over_18 and not (v and v.over_18)) %} collapsed{% endif %}">
|
|
|
|
<span class="comment-collapse-desktop hidden d-md-block" {% if not c.unread %}style="border-left: 2px solid #{{c.author.namecolor}};"{% endif %} onclick="collapse_comment('{{c.id}}')"></span>
|
|
|
|
<div class="flex flex-col flex-shrink-0 items-center mr-2.5 {{ 'md:mr-4' if not c.parent_comment_id or standalone else 'md:mr-3' }}">
|
|
<div class="relative {{ 'santa' if c.author.patron else 'cap' }}">
|
|
{% if standalone or level==1 %}
|
|
<img loading="lazy" src="{{ c.author.profile_url }}" class="hidden md:block flex-shrink-0 w-14 h-14 mb-2 p-[3px] bg-white border border-gray-300 object-cover lozad" alt="{{ c.author.username }} avatar"/>
|
|
{% else %}
|
|
<img loading="lazy" src="{{ c.author.profile_url }}" class="hidden md:block flex-shrink-0 w-9 h-9 mb-2 p-[3px] bg-white border border-gray-300 object-cover lozad" alt="{{ c.author.username }} avatar"/>
|
|
{% endif %}
|
|
</div>
|
|
<button onclick="collapse_comment('{{c.id}}')" class="md:ml-4 mb-2 w-[1px] md:w-4 h-full border-l border-gray-400"></button>
|
|
</div>
|
|
|
|
<div class="w-full">
|
|
|
|
<div id="{% if comment_info and comment_info.id == c.id %}context{%else%}comment-{{c.id}}-only{% endif %}" class="comment-anchor relative {% if comment_info and comment_info.id == c.id %}context{%endif%}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}">
|
|
|
|
|
|
{% if c.active_flags %}
|
|
<div id="flaggers-{{c.id}}" class="flaggers hidden">
|
|
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
|
<pre></pre>
|
|
<ul style="padding-left:20px; margin-bottom: 0;">
|
|
{% for f in c.ordered_flags %}
|
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.reason | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a href="javascript:void(0)" onclick="post_toast('/del_report/c{{ f.id }}')">[remove]</a>{% endif %}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if c.is_banned and c.ban_reason %}
|
|
<div id="comment-banned-warning" class="comment-text text-red-600 mb-0">Removed by @{{c.ban_reason}}</div>
|
|
{% endif %}
|
|
|
|
<div id="comment-text-{{c.id}}" class="comment-text text-black mb-0 {% if c.award_count("candycane") %}candycane{% endif %} {% if c.award_count("snow") %}snow{% endif %}">
|
|
{{c.realbody(v) | safe}}
|
|
{% if c.options %}
|
|
{% for o in c.options %}
|
|
<div class="custom-control">
|
|
<input type="checkbox" class="custom-control-input" id="{{o.id}}" name="option" {% if o.poll_voted(v) %}checked{% endif %} onchange="poll_vote('{{o.id}}', '{{c.id}}')">
|
|
<label class="custom-control-label" for="{{o.id}}">{{o.body_html | safe}}<span class="presult-{{c.id}} {% if not c.total_poll_voted(v) %}hidden{% endif %}"> - <a href="/votes?link=t3_{{o.id}}"><span id="poll-{{o.id}}">{{o.upvotes}}</span> votes</a></span></label>
|
|
</div>
|
|
{% endfor %}
|
|
<pre></pre>
|
|
{% endif %}
|
|
|
|
{% if c.author.sig_html and (c.author_id == 1904 or not (v and v.sigs_disabled)) %}
|
|
<hr>
|
|
{{c.author.sig_html | safe}}
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if render_replies %}
|
|
{% if level<5 %}
|
|
<div id="replies-of-{{c.id}}">
|
|
{% for reply in replies %}
|
|
{{single_comment(reply, level=level+1)}}
|
|
{% endfor %}
|
|
</div>
|
|
{% elif replies and "notifications" in request.path %}
|
|
<div id="replies-of-{{c.id}}" class="hidden md:block">
|
|
{% set standalone=False %}
|
|
{% for reply in replies %}
|
|
{{single_comment(reply, level=level+1)}}
|
|
{% endfor %}
|
|
</div>
|
|
<div id="morecomment-{{c.id}}" class="md:hidden mt-2 more-comments text-small">
|
|
<a {% if v %}href="{{c.shortlink}}"{% else %}href="/logged_out{{c.shortlink}}"{% endif %}>More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
|
|
</div>
|
|
{% elif replies %}
|
|
<div id="morecomment-{{c.id}}" class="mt-2 more-comments text-small">
|
|
<a {% if v %}href="{{c.shortlink}}"{% else %}href="/logged_out{{c.shortlink}}"{% endif %}>More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
|
|
{% include "/modals/ModalCommentActions.html" %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
{% for comment in comments %}
|
|
|
|
{{single_comment(comment)}}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
<style>
|
|
.mod:before {
|
|
content: '(((';
|
|
}
|
|
|
|
.mod:after {
|
|
content: ')))';
|
|
}
|
|
|
|
.mod {
|
|
padding: 2px 5px 3px 5px;
|
|
border-radius: 5px;
|
|
color:white!important;
|
|
background: -moz-linear-gradient(180deg, red, orange, yellow, green, blue, indigo, violet);
|
|
background: -webkit-linear-gradient(left, red, orange, yellow, green, blue, indigo, violet );
|
|
text-shadow:-1px -1px 0 black,1px -1px 0 black,-1px 1px 0 black,1px 1px 0 black;
|
|
}
|
|
|
|
.popover {
|
|
max-width: 100%;
|
|
box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175);
|
|
border-color: #dadada;
|
|
}
|
|
|
|
.popover-arrow {
|
|
display: none !important;
|
|
}
|
|
|
|
.popover-user-profile {
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 0;
|
|
background: var(--gray-600);
|
|
}
|
|
|
|
.popover-body {
|
|
padding: 0;
|
|
border-radius: .25rem;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.mt-n6 {
|
|
margin-top: -1.75rem !important;
|
|
}
|
|
|
|
.avatar-72 {
|
|
width: 72px;
|
|
height: 72px;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.h-64 {
|
|
height: 64px;
|
|
}
|
|
|
|
.object-cover {
|
|
object-fit: cover;
|
|
}
|
|
|
|
.smolbtn {
|
|
font-weight: 600;
|
|
font-size: .9rem;
|
|
border-radius: 0.2rem;
|
|
padding: 0.1rem 0.50rem 0rem 0.30rem;
|
|
background-color: var(--black) !important;
|
|
}
|
|
|
|
.smol {
|
|
font-size: 11.5px;
|
|
}
|
|
</style> |