remotes/1693045480750635534/spooky-22
Aevann1 2021-09-05 13:37:23 +02:00
parent 51c3acf90a
commit 52b6951b7b
3 changed files with 7 additions and 28 deletions

View File

@ -154,6 +154,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
v=v,
p=self,
sort=sort,
read=read,
linked_comment=comment,
comment_info=comment_info,
render_replies=True,

View File

@ -181,32 +181,10 @@ def post_id(pid, anything=None, v=None):
post.preloaded_comments = [x for x in comments if not (x.author and x.author.shadowbanned) or (v and v.id == x.author_id)]
read = session["read_comments"]
read_comments = [x.id for x in post.preloaded_comments]
if session.get("read_comments"): session["read_comments"] += read_comments
else: session["read_comments"] = read_comments
post.views += 1
@ -220,7 +198,7 @@ def post_id(pid, anything=None, v=None):
post.tree_comments()
if request.headers.get("Authorization"): return post.json
else: return post.rendered_page(v=v, sort=sort)
else: return post.rendered_page(v=v, read, sort=sort)
@app.post("/edit_post/<pid>")

View File

@ -111,7 +111,7 @@
<div class="comment-body">
<div id="{% if comment_info and comment_info.id == c.id %}context{%else%}comment-{{c.id}}-only{% endif %}" class="{% if comment_info and comment_info.id == c.id %}context{%endif%}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}">
<div id="{% if comment_info and comment_info.id == c.id %}context{%else%}comment-{{c.id}}-only{% endif %}" class="{% if comment_info and comment_info.id == c.id %}context{%endif%}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}" {% if read and c.id not in read %}style="background-color: rgba(179,229,255,0.5)"{% endif %}>
<div class="user-info">
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.id}}')"></span>