link the admigger upload threads in the admin panel for easier access

master
Aevann1 2022-09-11 09:11:10 +02:00
parent fac017bea1
commit b0057483c8
4 changed files with 20 additions and 4 deletions

View File

@ -128,7 +128,6 @@ PERMS = { # Minimum admin_level to perform action.
'ADMIN_CATEGORIES_CHANGE': 2, # change category on post ("recategorize") 'ADMIN_CATEGORIES_CHANGE': 2, # change category on post ("recategorize")
'ADMIN_CATEGORIES_MANAGE': 3, # create/update/delete categories 'ADMIN_CATEGORIES_MANAGE': 3, # create/update/delete categories
'HOLE_CREATE': 0, 'HOLE_CREATE': 0,
'CONTENT_THREADS': 3,
'FLAGS_REMOVE': 2, 'FLAGS_REMOVE': 2,
'VOTES_VISIBLE': 0, 'VOTES_VISIBLE': 0,
'USER_BLOCKS_VISIBLE': 0, 'USER_BLOCKS_VISIBLE': 0,
@ -293,7 +292,6 @@ elif SITE == 'watchpeopledie.co':
FEATURES['PATRON_ICONS'] = True FEATURES['PATRON_ICONS'] = True
PERMS['HOLE_CREATE'] = 2 PERMS['HOLE_CREATE'] = 2
PERMS['CONTENT_THREADS'] = 2
HOLE_NAME = 'flair' HOLE_NAME = 'flair'
HOLE_STYLE_FLAIR = True HOLE_STYLE_FLAIR = True

View File

@ -58,4 +58,4 @@ def inject_constants():
"CASINO_ENABLED":CASINO_ENABLED, "GUMROAD_LINK":GUMROAD_LINK, "CASINO_ENABLED":CASINO_ENABLED, "GUMROAD_LINK":GUMROAD_LINK,
"DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION, "DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION,
"has_sidebar":has_sidebar, "has_logo":has_logo, "has_app":has_app, "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}

View File

@ -197,7 +197,7 @@ def comment(v):
file.save(oldname) file.save(oldname)
image = process_image(oldname) image = process_image(oldname)
if image == "": return {"error":"Image upload failed"} 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: if parent_post.id == SIDEBAR_THREAD:
li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/sidebar'), li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/sidebar'),
key=lambda e: int(e.split('.webp')[0]))[-1] key=lambda e: int(e.split('.webp')[0]))[-1]

View File

@ -10,6 +10,24 @@
<pre></pre> <pre></pre>
<h3>Admin Tools</h3> <h3>Admin Tools</h3>
{% if v.admin_level > 2 and (SIDEBAR_THREAD or BANNER_THREAD or BADGE_THREAD or SNAPPY_THREAD) %}
<h4>Add Stuff</h4>
<ul>
{% if SIDEBAR_THREAD %}
<li><a href="/post/{{SIDEBAR_THREAD}}">Add Sidebar Images</a></li>
{% endif %}
{% if BANNER_THREAD %}
<li><a href="/post/{{BANNER_THREAD}}">Add Banners</a></li>
{% endif %}
{% if BADGE_THREAD %}
<li><a href="/post/{{BADGE_THREAD}}">Add Badges</a></li>
{% endif %}
{% if SNAPPY_THREAD %}
<li><a href="/post/{{SNAPPY_THREAD}}">Add Snappy Quotes</a></li>
{% endif %}
</ul>
{% endif %}
<h4>Content</h4> <h4>Content</h4>
<ul> <ul>
<li><a href="/log">Moderation Log</a></li> <li><a href="/log">Moderation Log</a></li>