diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 8bd20a16c..4f04816df 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -1793,7 +1793,7 @@ a.badge:hover, a.badge:focus { } a.badge-secondary:hover, a.badge-secondary:focus { color: #fff; - background-color: #545b62; + background-color: var(--primary); } a.badge-secondary:focus, a.badge-secondary.focus { outline: 0; diff --git a/files/assets/js/mobile_navigation_bar.js b/files/assets/js/mobile_navigation_bar.js index 8494d58c5..38409d9b6 100644 --- a/files/assets/js/mobile_navigation_bar.js +++ b/files/assets/js/mobile_navigation_bar.js @@ -1,4 +1,4 @@ -window.onload = function () { +window.addEventListener("load",function(event) { var prevScrollpos = window.pageYOffset; window.onscroll = function () { var currentScrollPos = window.pageYOffset; @@ -43,4 +43,4 @@ window.onload = function () { } prevScrollpos = currentScrollPos; } -} \ No newline at end of file +}) \ No newline at end of file diff --git a/files/assets/js/popover.js b/files/assets/js/popover.js index 07be6fc4e..8bcaaeaba 100644 --- a/files/assets/js/popover.js +++ b/files/assets/js/popover.js @@ -1,4 +1,4 @@ -window.onload = function() { +window.addEventListener("load",function(event) { function eventasdf(value){ var content_id = value.getAttributeNode("data-content-id").value; value.addEventListener("click", function(){jhkj(content_id)}); @@ -29,8 +29,9 @@ window.onload = function() { document.body.removeChild(popover_shit); } + var usernames = document.querySelectorAll("a.user-name"); usernames.forEach(eventasdf); document.addEventListener("click", function(e){dfgh(e)}); - }; \ No newline at end of file +}); \ No newline at end of file diff --git a/files/classes/comment.py b/files/classes/comment.py index b11502826..975264e7d 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -13,8 +13,8 @@ from .flags import CommentFlag from random import randint site = environ.get("DOMAIN").strip() -if site == 'pcmemes.net': cc = "splash mountain" -else: cc = "country club" +if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN" +else: cc = "COUNTRY CLUB" class Comment(Base): @@ -305,7 +305,7 @@ class Comment(Base): return data def realbody(self, v): - if self.post and self.post.club and not (v and v.paid_dues): return f"

{cc} ONLY

" + if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"

{cc} ONLY

" body = self.body_html @@ -342,7 +342,7 @@ class Comment(Base): return body def plainbody(self, v): - if self.post and self.post.club and not (v and v.paid_dues): return f"

{cc} ONLY

" + if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"

{cc} ONLY

" body = self.body diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index e2310965e..e2ec233f6 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -6,8 +6,8 @@ from files.helpers.lazy import lazy from os import environ site = environ.get("DOMAIN").strip() -if site == 'pcmemes.net': cc = "splash mountain" -else: cc = "country club" +if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN" +else: cc = "COUNTRY CLUB" class ModAction(Base): __tablename__ = "modactions" @@ -82,7 +82,7 @@ class ModAction(Base): @lazy def string(self): - output = ACTIONTYPES[self.kind]["str"].format(self=self, cc=cc) + output = ACTIONTYPES[self.kind]["str"].format(self=self) if self.note: output += f" ({self.note})" @@ -93,7 +93,7 @@ class ModAction(Base): def target_link(self): if self.target_user: return f'{self.target_user.username}' elif self.target_post: - if self.target_post.club: return f'{cc.upper()} ONLY' + if self.target_post.club: return f'{cc} ONLY' return f'{self.target_post.title.replace("<","").replace(">","")}' elif self.target_comment_id: return f'comment' diff --git a/files/routes/admin.py b/files/routes/admin.py index 08abf81eb..edd32391e 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1016,8 +1016,7 @@ def api_ban_comment(c_id, v): def api_unban_comment(c_id, v): comment = g.db.query(Comment).filter_by(id=c_id).first() - if not comment: - abort(404) + if not comment: abort(404) g.db.add(comment) if comment.is_banned: @@ -1037,26 +1036,20 @@ def api_unban_comment(c_id, v): @app.post("/distinguish_comment/") -@auth_required +@admin_level_required(1) def admin_distinguish_comment(c_id, v): - if v.admin_level == 0: abort(403) comment = get_comment(c_id, v=v) - if comment.author_id != v.id: - abort(403) + if comment.author_id != v.id: abort(403) comment.distinguish_level = 0 if comment.distinguish_level else v.admin_level g.db.add(comment) - html=render_template( - "comments.html", - v=v, - comments=[comment], - ) + html = render_template("comments.html", v=v, comments=[comment]) - html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only")) + html = str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only")) g.db.commit() diff --git a/files/routes/users.py b/files/routes/users.py index 2f9aa8b5c..7bd649177 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -646,17 +646,13 @@ def u_username_comments(username, v=None): if request.headers.get("Authorization"): return {"error": "That userpage is private"} else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v) - if hasattr(u, 'is_blocking') and u.is_blocking and (not v or v.admin_level < 2): + if v and hasattr(u, 'is_blocking') and u.is_blocking: if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."} - else: return render_template("userpage_blocking.html", - u=u, - v=v) + else: return render_template("userpage_blocking.html", u=u, v=v) - if hasattr(u, 'is_blocked') and u.is_blocked and (not v or v.admin_level < 2): + if v and v.admin_level < 2 and hasattr(u, 'is_blocked') and u.is_blocked: if request.headers.get("Authorization"): return {"error": "This person is blocking you."} - else: return render_template("userpage_blocked.html", - u=u, - v=v) + else: return render_template("userpage_blocked.html", u=u, v=v) page = int(request.values.get("page", "1")) diff --git a/files/templates/admin/image_posts.html b/files/templates/admin/image_posts.html index a8aa14756..c248b3667 100644 --- a/files/templates/admin/image_posts.html +++ b/files/templates/admin/image_posts.html @@ -12,28 +12,27 @@ {% block fixedMobileBarJS %} {% endblock %} diff --git a/files/templates/admin/reported_posts.html b/files/templates/admin/reported_posts.html index a748c65bc..08c3a0c53 100644 --- a/files/templates/admin/reported_posts.html +++ b/files/templates/admin/reported_posts.html @@ -40,28 +40,27 @@ {% block fixedMobileBarJS %} {% endblock %} diff --git a/files/templates/authforms.html b/files/templates/authforms.html index cc66fec5e..019abbb7e 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/ban_modal.html b/files/templates/ban_modal.html index 9b0739a22..6c0e2e8d9 100644 --- a/files/templates/ban_modal.html +++ b/files/templates/ban_modal.html @@ -1,30 +1,27 @@ - + - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 9cec011df..07ac140ab 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -114,7 +114,7 @@
- + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 2de28f201..1a42640b8 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -12,7 +12,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 7bf00f4ed..affd9cfed 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -36,10 +36,10 @@ {% if v %} - + {% else %} - + {% endif %} @@ -168,7 +168,7 @@ {% block scripts %} {% endblock %} - +
diff --git a/files/templates/settings_css.html b/files/templates/settings_css.html index 8731cbaaa..760b14214 100644 --- a/files/templates/settings_css.html +++ b/files/templates/settings_css.html @@ -38,15 +38,15 @@
{% if v.agendaposter %} {% endif %} diff --git a/files/templates/settings_security.html b/files/templates/settings_security.html index b0a4b487c..5d1fd4169 100644 --- a/files/templates/settings_security.html +++ b/files/templates/settings_security.html @@ -5,16 +5,14 @@ {% block content %}
diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index e7b05cc0c..c84ad296b 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -28,7 +28,7 @@ - + @@ -146,7 +146,7 @@
- + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 06194c7d4..7e2007bcc 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -29,7 +29,7 @@ - + @@ -96,7 +96,7 @@ - + diff --git a/files/templates/submission_banned.html b/files/templates/submission_banned.html index 7f591e9e4..03cc544ac 100644 --- a/files/templates/submission_banned.html +++ b/files/templates/submission_banned.html @@ -25,7 +25,7 @@ {% endif %} -{% if v.admin_level > 1 and v.id==p.author_id %} +{% if v.admin_level > 0 and v.id==p.author_id %}
diff --git a/files/templates/submit.html b/files/templates/submit.html index e01bf1cc4..78b0b2075 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -23,11 +23,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} @@ -173,7 +173,7 @@ {% endblock %} - + diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 4d25e2aed..bced9f259 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -35,7 +35,6 @@ {% if v %} + {% endif %} {% if u.song %} + {% endif %}
diff --git a/files/templates/userpage_blocked.html b/files/templates/userpage_blocked.html index 54e6f85ef..57edf0954 100644 --- a/files/templates/userpage_blocked.html +++ b/files/templates/userpage_blocked.html @@ -4,28 +4,27 @@ {% block fixedMobileBarJS %} {% endblock %} diff --git a/files/templates/userpage_blocking.html b/files/templates/userpage_blocking.html index 51cf27d30..3355d36c1 100644 --- a/files/templates/userpage_blocking.html +++ b/files/templates/userpage_blocking.html @@ -4,28 +4,27 @@ {% block fixedMobileBarJS %} {% endblock %} diff --git a/files/templates/userpage_reserved.html b/files/templates/userpage_reserved.html index fd2f335d0..b30d55206 100644 --- a/files/templates/userpage_reserved.html +++ b/files/templates/userpage_reserved.html @@ -4,28 +4,27 @@ {% block fixedMobileBarJS %} {% endblock %}