From 7d44f8456f673eddcdc2e6e1aaa58ab930f99163 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 5 Mar 2022 21:46:47 +0200 Subject: [PATCH] uk --- files/classes/user.py | 2 +- files/routes/subs.py | 4 ++++ files/templates/authforms.html | 2 +- files/templates/default.html | 11 +++++++++-- 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, 26 insertions(+), 15 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 2c41295af..4749164f6 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -154,7 +154,7 @@ class User(Base): @lazy def mods(self, sub): - return self.id == AEVANN_ID or bool(g.db.query(Mod.user_id).filter_by(user_id=self.id, sub=sub).one_or_none()) + return self.admin_level == 3 or bool(g.db.query(Mod.user_id).filter_by(user_id=self.id, sub=sub).one_or_none()) @lazy def exiled_from(self, sub): diff --git a/files/routes/subs.py b/files/routes/subs.py index 3c9739111..19e6f07d1 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -24,6 +24,8 @@ def exile_post(v, pid): u = p.author + if u.mods(sub): abort(403) + if u.admin_level < 2 and not u.exiled_from(sub): exile = Exile(user_id=u.id, sub=sub, exiler_id=v.id) g.db.add(exile) @@ -77,6 +79,8 @@ def exile_comment(v, cid): u = c.author + if u.mods(sub): abort(403) + if u.admin_level < 2 and not u.exiled_from(sub): exile = Exile(user_id=u.id, sub=sub, exiler_id=v.id) g.db.add(exile) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 7df8ef0cd..df5df78e8 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + + {% if SITE_NAME == 'Drama' and not request.path.startswith('/s/') %} + + {% endif %} {% if v.agendaposter %} - + + {% if SITE_NAME == 'Drama' and not request.path.startswith('/s/') %} + + {% endif %} + {% endif %} {% if sub and sub.css and not request.path.endswith('settings') %} diff --git a/files/templates/log.html b/files/templates/log.html index e18637694..fbef4012c 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 376c1cb76..1c9009ac3 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 679690667..c9324afa3 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 72791e3bb..1f1a169d9 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 126cc1ce1..59a208969 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}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index dd15cd515..d8cd8d495 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}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 16c0075eb..d075fa8dc 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}