remotes/1693045480750635534/spooky-22
Aevann1 2021-08-07 17:40:42 +02:00
parent 562eb00b27
commit cfe90af57d
2 changed files with 7 additions and 10 deletions

View File

@ -92,9 +92,6 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
def score_disputed(self):
return (self.upvotes+1) * (self.downvotes+1)
def children(self, v):
return sorted([x for x in self.child_comments if not x.author.shadowbanned or (v and v.id == x.author_id)], key=lambda x: x.score, reverse=True)
@property
@lazy
def parent(self):
@ -116,7 +113,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
def replies(self):
r = self.__dict__.get("replies", None)
if not r: r = self.child_comments
if not r: r = sorted([x for x in self.child_comments], key=lambda x: x.score, reverse=True)
return r
@replies.setter

View File

@ -44,14 +44,14 @@
{% if level<6 %}
<div id="replies-of-{{c.id}}" class="">
{% set standalone=False %}
{% for reply in c.children(v) %}
{% for reply in c.replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif c.children(v) %}
{% elif c.replies %}
<div id="replies-of-{{c.id}}" class="d-none d-md-block">
{% set standalone=False %}
{% for reply in c.children(v) %}
{% for reply in c.replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
@ -376,13 +376,13 @@
{% if render_replies %}
{% if level<6 %}
<div id="replies-of-{{c.id}}">
{% for reply in c.children(v) %}
{% for reply in c.replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif c.children(v) %}
{% elif c.replies %}
<div id="replies-of-{{c.id}}" class="d-none d-md-block">
{% for reply in c.children(v) %}
{% for reply in c.replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>