From b0057483c8db2a07de087b8fe141e4b0580e3982 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 11 Sep 2022 09:11:10 +0200 Subject: [PATCH] link the admigger upload threads in the admin panel for easier access --- files/helpers/const.py | 2 -- files/helpers/jinja2.py | 2 +- files/routes/comments.py | 2 +- files/templates/admin/admin_home.html | 18 ++++++++++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 403f47306..5fa74cfd4 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -128,7 +128,6 @@ PERMS = { # Minimum admin_level to perform action. 'ADMIN_CATEGORIES_CHANGE': 2, # change category on post ("recategorize") 'ADMIN_CATEGORIES_MANAGE': 3, # create/update/delete categories 'HOLE_CREATE': 0, - 'CONTENT_THREADS': 3, 'FLAGS_REMOVE': 2, 'VOTES_VISIBLE': 0, 'USER_BLOCKS_VISIBLE': 0, @@ -293,7 +292,6 @@ elif SITE == 'watchpeopledie.co': FEATURES['PATRON_ICONS'] = True PERMS['HOLE_CREATE'] = 2 - PERMS['CONTENT_THREADS'] = 2 HOLE_NAME = 'flair' HOLE_STYLE_FLAIR = True diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 707e0f506..12909d90c 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -58,4 +58,4 @@ def inject_constants(): "CASINO_ENABLED":CASINO_ENABLED, "GUMROAD_LINK":GUMROAD_LINK, "DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION, "has_sidebar":has_sidebar, "has_logo":has_logo, "has_app":has_app, - "FP":FP, "NOTIF_MODACTION_JL_MIN":NOTIF_MODACTION_JL_MIN, "cache":cache, "ONLINE_STR":ONLINE_STR, "patron":patron, "approved_embed_hosts":approved_embed_hosts, "dues":dues} + "FP":FP, "NOTIF_MODACTION_JL_MIN":NOTIF_MODACTION_JL_MIN, "cache":cache, "ONLINE_STR":ONLINE_STR, "patron":patron, "approved_embed_hosts":approved_embed_hosts, "dues":dues, "SIDEBAR_THREAD":SIDEBAR_THREAD, "BANNER_THREAD":BANNER_THREAD, "BADGE_THREAD":BADGE_THREAD, "SNAPPY_THREAD":SNAPPY_THREAD} diff --git a/files/routes/comments.py b/files/routes/comments.py index eaabce1da..44acfb957 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -197,7 +197,7 @@ def comment(v): file.save(oldname) image = process_image(oldname) if image == "": return {"error":"Image upload failed"} - if v.admin_level >= PERMS['CONTENT_THREADS'] and level == 1: + if v.admin_level > 2 and level == 1: if parent_post.id == SIDEBAR_THREAD: li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/sidebar'), key=lambda e: int(e.split('.webp')[0]))[-1] diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index 834719cc1..415c55315 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -10,6 +10,24 @@

 

Admin Tools

+{% if v.admin_level > 2 and (SIDEBAR_THREAD or BANNER_THREAD or BADGE_THREAD or SNAPPY_THREAD) %} +

Add Stuff

+ +{% endif %} +

Content