From 5ed3a75786f1df3cb127c45e4deb8b44a32ceebf Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 31 Dec 2021 19:38:11 +0200 Subject: [PATCH] fddsf --- files/routes/comments.py | 9 +++++++++ files/routes/posts.py | 12 +++++++++--- files/templates/authforms.html | 4 ++-- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 ++-- 12 files changed, 33 insertions(+), 18 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 399e3a9eb..cf066f666 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -330,6 +330,7 @@ def api_comment(v): level=level+1, is_bot=True, body_html=body_based_html, + top_comment_id=c.top_comment_id ) g.db.add(c_based) @@ -361,6 +362,7 @@ def api_comment(v): level=level+1, is_bot=True, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) @@ -394,6 +396,7 @@ def api_comment(v): level=level+1, is_bot=True, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) @@ -425,6 +428,7 @@ def api_comment(v): level=level+1, is_bot=True, body_html=body_html2, + top_comment_id=c.top_comment_id ) g.db.add(c2) @@ -460,6 +464,7 @@ def api_comment(v): level=level+1, is_bot=True, body_html=body_html2, + top_comment_id=c.top_comment_id ) g.db.add(c2) @@ -483,6 +488,7 @@ def api_comment(v): level=level+2, is_bot=True, body_html=body_html2, + top_comment_id=c.top_comment_id ) g.db.add(c3) @@ -499,6 +505,7 @@ def api_comment(v): level=level+3, is_bot=True, body_html=body_html2, + top_comment_id=c.top_comment_id ) g.db.add(c4) @@ -728,6 +735,7 @@ def edit_comment(cid, v): level=c.level+1, is_bot=True, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) @@ -762,6 +770,7 @@ def edit_comment(cid, v): level=c.level+1, is_bot=True, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) diff --git a/files/routes/posts.py b/files/routes/posts.py index 35feda038..1d4ede0d0 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -345,6 +345,8 @@ def viewmore(v, pid, sort, offset): @limiter.limit("1/second") @auth_desired def morecomments(v, cid): + tcid = g.db.query(Comment.top_comment_id).filter_by(id=cid).one_or_none()[0] + if v: votes = g.db.query(CommentVote).filter_by(user_id=v.id).subquery() @@ -357,7 +359,7 @@ def morecomments(v, cid): votes.c.vote_type, blocking.c.id, blocked.c.id, - ).filter_by(parent_comment_id=cid).join( + ).filter(Comment.top_comment_id == tcid, Comment.level > 10).join( votes, votes.c.comment_id == Comment.id, isouter=True @@ -377,7 +379,7 @@ def morecomments(v, cid): comment.voted = c[1] or 0 comment.is_blocking = c[2] or 0 comment.is_blocked = c[3] or 0 - output.append(comment) + if c[0].parent_comment_id == int(cid): output.append(comment) comments = output else: c = g.db.query(Comment).filter_by(id=cid).first() @@ -511,6 +513,7 @@ def edit_post(pid, v): is_pinned='AutoJanny', distinguish_level=6, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) @@ -543,6 +546,7 @@ def edit_post(pid, v): is_pinned='AutoJanny', distinguish_level=6, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) @@ -1072,6 +1076,7 @@ def submit_post(v): is_pinned='AutoJanny', distinguish_level=6, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) @@ -1104,6 +1109,7 @@ def submit_post(v): is_pinned='AutoJanny', distinguish_level=6, body_html=body_jannied_html, + top_comment_id=c.top_comment_id ) g.db.add(c_jannied) @@ -1159,7 +1165,7 @@ def submit_post(v): over_18=False, is_bot=True, app_id=None, - body_html=body_html, + body_html=body_html ) g.db.add(c) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 3aca497ab..006c267c5 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 85571ac70..4f808176c 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 642c02a6e..50f3d809f 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index b655defda..794920193 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index d2dc2cb4f..1df51ebd4 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 8d171a00c..eff79a718 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 2886c54e0..e56e2412b 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index c69b0aa42..6c55b27c3 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 32258bf94..27de35082 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}