diff --git a/files/routes/posts.py b/files/routes/posts.py index 83620fd61..d59a6b9dc 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -394,7 +394,7 @@ def viewmore(v, pid, sort, offset): else: offset += 1 comments = comments2 - return render_template("comments.html", v=v, comments=comments, ids=list(ids), render_replies=True, pid=pid, sort=sort, offset=offset, ajax=True) + return render_template("comments.html", v=v, comments=comments, p=post, ids=list(ids), render_replies=True, pid=pid, sort=sort, offset=offset, ajax=True) @app.get("/morecomments/") @@ -443,7 +443,8 @@ def morecomments(v, cid): c = g.db.query(Comment).filter_by(id=cid).one_or_none() comments = c.replies - return render_template("comments.html", v=v, comments=comments, render_replies=True, ajax=True) + p = comments[0].post + return render_template("comments.html", v=v, comments=comments, p=p, render_replies=True, ajax=True) @app.post("/edit_post/") @limiter.limit("1/second;30/minute;200/hour;1000/day") diff --git a/files/templates/comments.html b/files/templates/comments.html index 867aaf933..97c54fbe4 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -537,7 +537,7 @@ {% if c.post %} {% set sub = c.post.sub %} - {% if sub and v.mods(sub) %} + {% if sub and v.mods(sub) and not c.author.mods(sub) %} {% endif %} @@ -713,7 +713,7 @@ {% if c.post %} {% set sub = c.post.sub %} - {% if sub and v.mods(sub) %} + {% if sub and v.mods(sub) and not c.author.mods(sub) %} Exile user Unexile user {% endif %} @@ -887,10 +887,25 @@ +{% endif %} +{% if offset %} + {% if p %} + {% set pid = p.id %} + {% endif %} +
+
+{% endif %} + +{% if p %} {% endif %} -{% if offset %} - {% if p %} - {% set pid = p.id %} - {% endif %} -
-
-{% endif %} - \ No newline at end of file diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 579c4e131..3d1725f01 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -94,4 +94,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index 11e683d54..9f11224a7 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -78,8 +78,8 @@ {% endif %} - {% if p.sub and v.mods(p.sub) %} - Kick + {% if p.sub and v.mods(p.sub) and not p.author.mods(sub) %} + Remove Exile user Unexile user diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index f89769fdd..86718978b 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -50,8 +50,8 @@ {% endif %} {% endif %} -{% if p.sub and v.mods(p.sub) %} - +{% if p.sub and v.mods(p.sub) and not p.author.mods(sub) %} + diff --git a/files/templates/submission.html b/files/templates/submission.html index 71b852903..c711c3a89 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -1045,6 +1045,8 @@ {% endif %} {% if "?context" not in request.full_path %} + localStorage.setItem("old-comment-counts", localStorage.getItem("comment-counts")) + const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || {c: 0}).c + 1) comments['{{p.id}}'] = {c: newTotal, t: Date.now()}