remotes/1693045480750635534/spooky-22
Aevann1 2022-01-31 06:17:27 +02:00
parent 2e39f7e341
commit 4d778f6f06
2 changed files with 4 additions and 3 deletions

View File

@ -408,7 +408,8 @@ class Comment(Base):
return body
@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
@ -418,7 +419,7 @@ class Comment(Base):
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

View File

@ -187,7 +187,7 @@
{% set wager = split_result[4] %}
{% 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 %}
<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 %}