remotes/1693045480750635534/spooky-22
Aevann1 2021-08-23 20:52:56 +02:00
parent a3f31c2970
commit 3c85ad185b
2 changed files with 19 additions and 7 deletions

View File

@ -111,7 +111,6 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
if self.parent_comment_id: return f"t3_{self.parent_comment_id}"
elif self.parent_submission: return f"t2_{self.parent_submission}"
@property
@lazy
def replies(self):
@ -131,6 +130,13 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
def replies2(self, value):
self.__dict__["replies2"] = value
@property
@lazy
def replies3(self):
r = self.__dict__.get("replies", None)
if not r and r != []: r = sorted([x for x in self.child_comments], key=lambda x: x.score, reverse=True)
return r
@property
@lazy
def permalink(self):

View File

@ -11,6 +11,12 @@
{% set score=ups-downs %}
{% include "emoji_modal.html" %}
{% if v and v.shadowbanned %}
{% set replies=c.replies3 %}
{% else %}
{% set replies=c.replies %}
{% endif %}
<!--conditions under which a comment might be hidden-->
{% if (c.is_banned or c.deleted_utc > 0 or c.is_blocking or c.is_blocked) and not (v and v.admin_level>0) and not (v and v.id==c.author_id) %}
@ -42,14 +48,14 @@
{% if level<6 %}
<div id="replies-of-{{c.id}}" class="">
{% set standalone=False %}
{% for reply in c.replies %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif c.replies %}
{% elif replies %}
<div id="replies-of-{{c.id}}" class="d-none d-md-block">
{% set standalone=False %}
{% for reply in c.replies %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
@ -382,13 +388,13 @@
{% if render_replies %}
{% if level<6 %}
<div id="replies-of-{{c.id}}">
{% for reply in c.replies %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif c.replies %}
{% elif replies %}
<div id="replies-of-{{c.id}}" class="d-none d-md-block">
{% for reply in c.replies %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>