gf
This commit is contained in:
parent
4a924d4675
commit
974a16a2d8
3 changed files with 7 additions and 28 deletions
|
@ -154,6 +154,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
||||||
v=v,
|
v=v,
|
||||||
p=self,
|
p=self,
|
||||||
sort=sort,
|
sort=sort,
|
||||||
|
read=read,
|
||||||
linked_comment=comment,
|
linked_comment=comment,
|
||||||
comment_info=comment_info,
|
comment_info=comment_info,
|
||||||
render_replies=True,
|
render_replies=True,
|
||||||
|
|
|
@ -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)]
|
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
|
post.views += 1
|
||||||
|
@ -220,7 +198,7 @@ def post_id(pid, anything=None, v=None):
|
||||||
post.tree_comments()
|
post.tree_comments()
|
||||||
|
|
||||||
if request.headers.get("Authorization"): return post.json
|
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>")
|
@app.post("/edit_post/<pid>")
|
||||||
|
|
|
@ -111,7 +111,7 @@
|
||||||
|
|
||||||
<div class="comment-body">
|
<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">
|
<div class="user-info">
|
||||||
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.id}}')"></span>
|
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.id}}')"></span>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue