diff --git a/files/classes/submission.py b/files/classes/submission.py index 99f128d30..6075b5ba7 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -181,7 +181,7 @@ class Submission(Base): return f"/post/{self.id}/{output}" @lazy - def rendered_page(self, sort=None, last_view_utc=None, comment=None, comment_info=None, v=None): + def rendered_page(self, sort=None, comment=None, comment_info=None, v=None): if self.is_banned and not (v and (v.admin_level >= 3 or self.author_id == v.id)): template = "submission_banned.html" else: template = "submission.html" @@ -191,7 +191,6 @@ class Submission(Base): return render_template(template, v=v, p=self, - last_view_utc=last_view_utc, sort=sort, linked_comment=comment, comment_info=comment_info, diff --git a/files/routes/posts.py b/files/routes/posts.py index 03b81e69a..af90e76af 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -177,17 +177,6 @@ def post_id(pid, anything=None, v=None): post.preloaded_comments = comments.all() - if not v or v.highlightcomments: - last_view_utc = session.get(str(post.id)) - if last_view_utc: last_view_utc = int(last_view_utc) - session[str(post.id)] = int(time.time()) - - keys = [] - for key, val in session.items(): - if type(val) is int and key not in ['login_nonce','user_id']: - if time.time() - val > 86400: keys.append(key) - - for key in keys: session.pop(key) post.views += 1 g.db.add(post) @@ -198,9 +187,7 @@ def post_id(pid, anything=None, v=None): g.db.commit() if request.headers.get("Authorization"): return post.json - else: - if not v or v.highlightcomments: return post.rendered_page(v=v, last_view_utc=last_view_utc, sort=sort) - else: return post.rendered_page(v=v, sort=sort) + else: return post.rendered_page(v=v, sort=sort) @app.post("/edit_post/") diff --git a/files/templates/comments.html b/files/templates/comments.html index d2c0f92d2..ad2943f04 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -25,7 +25,7 @@ {% if v %} {% include "award_modal.html" %} - + {% endif %} @@ -171,7 +171,16 @@
- {% if last_view_utc and c.created_utc > last_view_utc and not (v and v.id==c.author_id) and (not v or v.highlightcomments) %}{% endif %} + {% if p and not (v and v.id==c.author_id) and (not v or v.highlightcomments) %} + +
+ {% endif %} {% if c.awards %} {% for a in c.awards %}