fdfd
This commit is contained in:
parent
f8e788b49d
commit
48faa851df
2 changed files with 19 additions and 7 deletions
|
@ -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):
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue