diff --git a/files/classes/comment.py b/files/classes/comment.py
index dd6edb7920..164a7b7753 100644
--- a/files/classes/comment.py
+++ b/files/classes/comment.py
@@ -33,6 +33,7 @@ class Comment(Base):
is_approved = Column(Integer, default=0)
level = Column(Integer, default=0)
parent_comment_id = Column(Integer, ForeignKey("comments.id"))
+ top_comment_id = Column(Integer)
over_18 = Column(Boolean, default=False)
is_bot = Column(Boolean, default=False)
is_pinned = Column(String)
diff --git a/files/routes/comments.py b/files/routes/comments.py
index c0144f45a6..71867fbf1f 100644
--- a/files/routes/comments.py
+++ b/files/routes/comments.py
@@ -147,11 +147,14 @@ def api_comment(v):
if parent_fullname.startswith("t2_"):
parent = parent_post
parent_comment_id = None
+ top_comment_id = None
level = 1
elif parent_fullname.startswith("t3_"):
parent = get_comment(parent_fullname.split("_")[1], v=v)
parent_comment_id = parent.id
level = parent.level + 1
+ if level == 2: top_comment_id = parent.id
+ else: top_comment_id = parent.top_comment_id
else: abort(400)
body = request.values.get("body", "").strip()[:10000]
@@ -276,6 +279,7 @@ def api_comment(v):
c = Comment(author_id=v.id,
parent_submission=parent_submission,
parent_comment_id=parent_comment_id,
+ top_comment_id=top_comment_id,
level=level,
over_18=request.host == 'pcmemes.net' and v.id == 1578 or parent_post.over_18 or request.values.get("over_18","")=="true",
is_bot=is_bot,
diff --git a/files/templates/submission.html b/files/templates/submission.html
index bab6ee38af..2ec1b0dd1b 100644
--- a/files/templates/submission.html
+++ b/files/templates/submission.html
@@ -811,6 +811,12 @@
{% include "comments.html" %}
{% endwith %}
+
+{% if offset %}
+
+ VIEW MORE
+{% endif %}
+
{% elif not p.replies and p.deleted_utc == 0 %}