From fac0b71acc054a8e5907fbcb5979628a4b5afcab Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 17 Dec 2021 09:06:25 +0200 Subject: [PATCH] fdsfds --- files/routes/admin.py | 8 ++++---- files/templates/CHRISTMAS/changelog.html | 2 +- files/templates/CHRISTMAS/default.html | 2 +- files/templates/CHRISTMAS/settings.html | 2 +- files/templates/admin/image_posts.html | 3 --- files/templates/admin/reported_posts.html | 3 --- files/templates/userpage.html | 25 ++++++++++++----------- files/templates/userpage_comments.html | 12 +++++++++++ files/templates/userpage_private.html | 12 +++++++++++ 9 files changed, 44 insertions(+), 25 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 00c647548..700ada0c6 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -967,15 +967,15 @@ def api_distinguish_post(post_id, v): @validate_formkey def api_sticky_post(post_id, v): - pins = g.db.query(Submission.id).filter(Submission.stickied != None, Submission.is_banned == False).count() - if pins > 2: return {"error": "Can't exceed 3 pinned posts limit!"}, 403 - post = g.db.query(Submission).filter_by(id=post_id).first() if post: if post.stickied: if post.stickied.startswith("t:"): abort(403) else: post.stickied = None - else: post.stickied = v.username + else: + pins = g.db.query(Submission.id).filter(Submission.stickied != None, Submission.is_banned == False).count() + if pins > 2: return {"error": "Can't exceed 3 pinned posts limit!"}, 403 + post.stickied = v.username g.db.add(post) ma=ModAction( diff --git a/files/templates/CHRISTMAS/changelog.html b/files/templates/CHRISTMAS/changelog.html index 50541444d..afb8591c9 100644 --- a/files/templates/CHRISTMAS/changelog.html +++ b/files/templates/CHRISTMAS/changelog.html @@ -104,6 +104,6 @@ {% endif %} - + {% endblock %} \ No newline at end of file diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html index e23662a86..d4fe66a4e 100644 --- a/files/templates/CHRISTMAS/default.html +++ b/files/templates/CHRISTMAS/default.html @@ -346,7 +346,7 @@ {% if v %} - + {% endif %} diff --git a/files/templates/CHRISTMAS/settings.html b/files/templates/CHRISTMAS/settings.html index 09aff7c82..8d61df2a3 100644 --- a/files/templates/CHRISTMAS/settings.html +++ b/files/templates/CHRISTMAS/settings.html @@ -215,7 +215,7 @@ {% if v %} - + {% endif %} \ No newline at end of file diff --git a/files/templates/admin/image_posts.html b/files/templates/admin/image_posts.html index ec6ec1d80..0ec4c92dc 100644 --- a/files/templates/admin/image_posts.html +++ b/files/templates/admin/image_posts.html @@ -53,7 +53,4 @@ {% endif %} -{% endblock %} - -{% block SongsTax %} {% endblock %} \ No newline at end of file diff --git a/files/templates/admin/reported_posts.html b/files/templates/admin/reported_posts.html index 7f5796b31..6305463c4 100644 --- a/files/templates/admin/reported_posts.html +++ b/files/templates/admin/reported_posts.html @@ -80,7 +80,4 @@ {% endif %} -{% endblock %} - -{% block SongsTax %} {% endblock %} \ No newline at end of file diff --git a/files/templates/userpage.html b/files/templates/userpage.html index eb9a735ea..b816afb53 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -683,6 +683,18 @@ +{% if u.song %} +
{{u.id}}
+{% endif %} + +{% if v %} +
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
+ +
{{u.username}}
+{% endif %} + + + {% endblock %} {% block pagenav %} @@ -720,16 +732,5 @@ {% endblock %} -{% block SongsTax %} - {% if u.song %} -
{{u.id}}
- {% endif %} - - {% if v %} -
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
- -
{{u.username}}
- {% endif %} - - +{% block GIFpicker %} {% endblock %} \ No newline at end of file diff --git a/files/templates/userpage_comments.html b/files/templates/userpage_comments.html index 2dbd53569..05129dcf7 100644 --- a/files/templates/userpage_comments.html +++ b/files/templates/userpage_comments.html @@ -103,4 +103,16 @@ {% endif %} + +{% if u.song %} +
{{u.id}}
+{% endif %} + +{% if v %} +
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
+ +
{{u.username}}
+{% endif %} + + {% endblock %} \ No newline at end of file diff --git a/files/templates/userpage_private.html b/files/templates/userpage_private.html index 476d680fa..41a90b3c8 100644 --- a/files/templates/userpage_private.html +++ b/files/templates/userpage_private.html @@ -30,6 +30,18 @@ + +{% if u.song %} +
{{u.id}}
+{% endif %} + +{% if v %} +
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
+ +
{{u.username}}
+{% endif %} + + {% endblock %} {% block pagenav %}