fix console errors caused by importing two comments.html
parent
89503a4878
commit
999205c638
|
@ -7648,6 +7648,12 @@ blink {
|
|||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
.admin-note + div + :not(.admin-note) {
|
||||
border-top: 2px solid var(--primary) !important;
|
||||
margin-top: 4rem !important;
|
||||
margin-bottom: 4rem !important;
|
||||
}
|
||||
|
||||
details {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
|
|
@ -902,16 +902,19 @@ def u_username_wall(v, username):
|
|||
|
||||
if v.admin_level >= PERMS['ADMIN_NOTES']:
|
||||
pinned = [c[0] for c in comments.filter(Comment.pinned != None).order_by(Comment.created_utc.desc())]
|
||||
for c in pinned:
|
||||
c.admin_note = True
|
||||
else:
|
||||
pinned = []
|
||||
|
||||
comments = comments.filter(Comment.pinned == None).order_by(Comment.created_utc.desc()) .offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
||||
comments = [c[0] for c in comments]
|
||||
comments = pinned + comments
|
||||
|
||||
if v.client:
|
||||
return {"data": [c.json for c in comments]}
|
||||
|
||||
return render_template("userpage/wall.html", u=u, v=v, pinned=pinned, listing=comments, page=page, total=total, is_following=is_following, standalone=True, render_replies=True, wall=True)
|
||||
return render_template("userpage/wall.html", u=u, v=v, listing=comments, page=page, total=total, is_following=is_following, standalone=True, render_replies=True, wall=True)
|
||||
|
||||
|
||||
@app.get("/@<username>/wall/comment/<int:cid>")
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if standalone and level == 1 %}
|
||||
<div id="post-info-{{c.id}}" class="post-info mb-1 mr-2 {% if request.path.startswith('/notifications') %}mt-5{% elif request.path == '/search/messages' %}mt-6{% else %}mt-3{% endif %}">
|
||||
<div id="post-info-{{c.id}}" class="{% if c.admin_note %}admin-note{% endif %} post-info mb-1 mr-2 {% if request.path.startswith('/notifications') %}mt-5{% elif request.path == '/search/messages' %}mt-6{% else %}mt-3{% endif %}">
|
||||
{% if c.parent_post and c.post.nsfw %}
|
||||
<span class="badge badge-danger text-small-extra mr-1">NSFW</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -10,13 +10,6 @@
|
|||
<div class="row no-gutters px-3 p-md-0 userpage-wall" style="margin-top: 10px">
|
||||
<div class="col">
|
||||
<div class="comment-section" id="replies-of-{{u.fullname}}">
|
||||
{% if pinned %}
|
||||
{% with comments=pinned %}
|
||||
{% include "comments.html" %}
|
||||
{% endwith %}
|
||||
<hr class="mt-5">
|
||||
{% endif %}
|
||||
|
||||
{% with comments=listing %}
|
||||
{% include "comments.html" %}
|
||||
{% endwith %}
|
||||
|
|
Loading…
Reference in New Issue