fix comment level 10 bug, thanks @everyone

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-10 02:47:48 +02:00
parent 744f847c73
commit 30bdee98b2
2 changed files with 13 additions and 17 deletions

View File

@ -634,7 +634,7 @@ def comment(v):
g.db.flush()
if request.headers.get("Authorization"): return c.json
return {"comment": render_template("comments.html", v=v, comments=[c], new_comment=True)}
return {"comment": render_template("comments.html", v=v, comments=[c])}

View File

@ -47,18 +47,16 @@
</div>
{% if render_replies %}
{% if new_comment or level<9 or request.path.startswith('/notifications') %}
<div id="replies-of-{{c.fullname}}">
<div id="replies-of-{{c.fullname}}">
{% if level<9 or request.path.startswith('/notifications') %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif replies %}
<div id="replies-of-{{c.fullname}}" class="mt-2 more-comments">
<button id="btn-{{c.id}}" class="d-none d-md-block btn btn-primary" onclick="morecomments('{{c.id}}')">More comments</button>
{% elif replies %}
<button id="btn-{{c.id}}" class="d-none d-md-block btn btn-primary mt-3" onclick="morecomments('{{c.id}}')">More comments</button>
<a class="d-md-none" href="{{c.morecomments}}">More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
</div>
{% endif %}
{% endif %}
</div>
{% endif %}
</div>
</div>
@ -554,18 +552,16 @@
{% endif %}
{% if render_replies %}
{% if new_comment or level<9 or request.path.startswith('/notifications') %}
<div id="replies-of-{{c.fullname}}">
<div id="replies-of-{{c.fullname}}">
{% if level<9 or request.path.startswith('/notifications') %}
{% for reply in replies %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif replies %}
<div id="replies-of-{{c.fullname}}" class="mt-2 more-comments">
<button id="btn-{{c.id}}" class="d-none d-md-block btn btn-primary" onclick="morecomments('{{c.id}}')">More comments</button>
{% elif replies %}
<button id="btn-{{c.id}}" class="d-none d-md-block btn btn-primary mt-3" onclick="morecomments('{{c.id}}')">More comments</button>
<a class="d-md-none" href="{{c.morecomments}}">More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
</div>
{% endif %}
{% endif %}
</div>
{% if request.path.startswith('/notifications') and c.level == 1 and c.sentto and not c.parent_submission and c.author_id != AUTOJANNY_ID %}
{% if (v and v.admin_level >= 2) and (c.sentto == 2) and not c.author.is_muted %}