zxc
This commit is contained in:
parent
cbdc56e608
commit
ce08569895
2 changed files with 4 additions and 3 deletions
|
@ -408,7 +408,8 @@ class Comment(Base):
|
||||||
return body
|
return body
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def collapse_for_user(self, v):
|
def collapse_for_user(self, v, path):
|
||||||
|
if path == '/admin/removed/comments': return False
|
||||||
|
|
||||||
if self.over_18 and not (v and v.over_18) and not (self.post and self.post.over_18): return True
|
if self.over_18 and not (v and v.over_18) and not (self.post and self.post.over_18): return True
|
||||||
|
|
||||||
|
@ -418,7 +419,7 @@ class Comment(Base):
|
||||||
|
|
||||||
if self.is_banned: return True
|
if self.is_banned: return True
|
||||||
|
|
||||||
if (self.slots_result or self.blackjack_result) and len(self.body) <= 20 and self.level > 1: return True
|
if path.startswith('/post') and (self.slots_result or self.blackjack_result) and len(self.body) <= 20 and self.level > 1: return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@
|
||||||
{% set wager = split_result[4] %}
|
{% set wager = split_result[4] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="comment-{{c.id}}" class="anchor {% if c.unread %}unread{% endif %} comment {% if standalone and level==1 %} mt-0{% endif %}{% if not request.path.startswith('/@') and c.collapse_for_user(v) and request.path != '/admin/removed/comments' or (standalone and c.over_18 and not (v and v.over_18)) %} collapsed{% endif %}" style="{% if isreply %}padding-left:0!important;{% elif not c.unread %}border-left: 2px solid {% if c.ghost %}var(--primary){% else %}#{{c.author.namecolor}};{% endif %}{% endif %} {% if c.unread %}padding: 10px 10px 10px !important;{% endif %}">
|
<div id="comment-{{c.id}}" class="anchor {% if c.unread %}unread{% endif %} comment {% if standalone and level==1 %} mt-0{% endif %} {% if c.collapse_for_user(v, request.path) and (standalone and c.over_18 and not (v and v.over_18)) %}collapsed{% endif %}" style="{% if isreply %}padding-left:0!important;{% elif not c.unread %}border-left: 2px solid {% if c.ghost %}var(--primary){% else %}#{{c.author.namecolor}};{% endif %}{% endif %} {% if c.unread %}padding: 10px 10px 10px !important;{% endif %}">
|
||||||
{% if not isreply %}
|
{% if not isreply %}
|
||||||
<span class="comment-collapse-desktop d-none d-md-block" {% if not c.unread %}style="border-left: 2px solid {% if c.ghost %}var(--primary){% else %}#{{c.author.namecolor}}{% endif %}"{% endif %} onclick="collapse_comment('{{c.id}}')"></span>
|
<span class="comment-collapse-desktop d-none d-md-block" {% if not c.unread %}style="border-left: 2px solid {% if c.ghost %}var(--primary){% else %}#{{c.author.namecolor}}{% endif %}"{% endif %} onclick="collapse_comment('{{c.id}}')"></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue