From 6b5f87a638aaed25b91a18ff5c49ce9770732b24 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 26 Jan 2023 07:45:38 +0200 Subject: [PATCH] icons --- files/helpers/config/modaction_types.py | 2 ++ files/routes/static.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/files/helpers/config/modaction_types.py b/files/helpers/config/modaction_types.py index 0e04317b4..1bb85322b 100644 --- a/files/helpers/config/modaction_types.py +++ b/files/helpers/config/modaction_types.py @@ -370,3 +370,5 @@ MODACTION_PRIVILEGED_TYPES = {'shadowban', 'unshadowban', MODACTION_PRIVILEGED__TYPES = {'progstack_post', 'progstack_comment'} MODACTION_TYPES_FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items() if not t in MODACTION_PRIVILEGED_TYPES}) +MODACTION_TYPES__FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items() + if not t in MODACTION_PRIVILEGED__TYPES}) diff --git a/files/routes/static.py b/files/routes/static.py index 068a7a6f0..d08065346 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -138,7 +138,11 @@ def log(v:User): kind = request.values.get("kind") - if v and v.admin_level >= PERMS['USER_SHADOWBAN']: types = MODACTION_TYPES + if v and v.admin_level >= PERMS['USER_SHADOWBAN']: + if v and v.admin_level >= PERMS['PROGSTACK']: + types = MODACTION_TYPES + else: + types = MODACTION_TYPES__FILTERED else: types = MODACTION_TYPES_FILTERED if kind and kind not in types: @@ -181,7 +185,11 @@ def log_item(id, v): admins = [x[0] for x in g.db.query(User.username).filter(User.admin_level >= PERMS['ADMIN_MOP_VISIBLE']).all()] - if v and v.admin_level >= PERMS['USER_SHADOWBAN']: types = MODACTION_TYPES + if v and v.admin_level >= PERMS['USER_SHADOWBAN']: + if v and v.admin_level >= PERMS['PROGSTACK']: + types = MODACTION_TYPES + else: + types = MODACTION_TYPES__FILTERED else: types = MODACTION_TYPES_FILTERED return render_template("log.html", v=v, actions=[action], next_exists=False, page=1, action=action, admins=admins, types=types, single_user_url='admin')