Deux: sidebar, sidebar thread; restrict holes.

remotes/1693045480750635534/spooky-22
Snakes 2022-07-14 02:19:59 -04:00
parent a55ef591e4
commit a217f76bad
3 changed files with 41 additions and 2 deletions

View File

@ -138,6 +138,7 @@ PERMS = { # Minimum admin_level to perform action.
'FLAGS_VISIBLE': 0,
'FLAGS_VISIBLE_REPORTER': 0,
'FLAGS_REMOVE': 2,
'CONTENT_THREADS': 3,
}
EMOJI_MARSEYS = True
@ -209,9 +210,9 @@ if SITE in ('rdrama.net', 'devrama.xyz'):
MARSEY_THREAD = 37838
GAMBLING_THREAD = 39413
elif SITE == 'deuxrama.net':
SIDEBAR_THREAD = 175
BADGE_THREAD = 142
if SITE in {'rdrama.net', 'devrama.xyz', 'deuxrama.net'}:
HOLE_COST = 50000
HOLE_INACTIVITY_DELETION = True
@ -353,6 +354,10 @@ elif SITE == 'lgbdropthet.com':
else: # localhost or testing environment implied
pass
if SITE == 'deuxrama.net':
PERMS['HOLE_CREATE'] = 3
PERMS['CONTENT_THREADS'] = 2
bots = {AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID, BASEDBOT_ID}
IMGUR_KEY = environ.get("IMGUR_KEY").strip()

View File

@ -195,7 +195,7 @@ def api_comment(v):
file.save(oldname)
image = process_image(oldname)
if image == "": return {"error":"Image upload failed"}
if v.admin_level > 2 and level == 1:
if v.admin_level >= PERMS['CONTENT_THREADS'] 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]

View File

@ -0,0 +1,34 @@
<div class="col sidebar text-left {% if '/sidebar' not in request.path %}d-none d-lg-block{% endif %} pt-3 pb-5 bg-white" id="sidebar-content">
{%- set art_path = "assets/images/" + SITE_NAME + "/sidebar/" -%}
{%- set sidebar_art = "/" + art_path + listdir('files/' + art_path)|random() + '?v=1' -%}
<img class="mb-4" alt="sidebar art" role="button" onclick="expandDesktopImage()" loading="lazy" src="{{sidebar_art}}" style="width: 100%">
<p class="text-center text-md mb-4">
<a class="sidebar-link" href="/marseys" data-bs-toggle="tooltip" data-bs-placement="top" title="Marseys"><i class="fas fa-cat"></i></a>
<a class="sidebar-link" href="/badges" data-bs-toggle="tooltip" data-bs-placement="top" title="Badges"><i class="fas fa-hexagon"></i></a>
<a class="sidebar-link" href="/admins" data-bs-toggle="tooltip" data-bs-placement="top" title="Admins"><i class="fas fa-crown"></i></a>
<a class="sidebar-link" href="/log" data-bs-toggle="tooltip" data-bs-placement="top" title="Moderation Log"><i class="fas fa-scroll-old"></i></a>
<a class="sidebar-link" href="/transfers" data-bs-toggle="tooltip" data-bs-placement="top" title="Transfers"><i class="fas fa-arrow-right-arrow-left"></i></a>
<a class="sidebar-link" href="/random_post/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
</p>
{% if v and v.admin_level >= 2 -%}
<p class="mt-1 ml-2 mb-4 text-center">
<span id="sidebar--counter--admin">
<a href="/admin/loggedin">Logged In</a> | <a href="/admin/loggedout">Logged Out</a>
</span>
</p>
{%- endif %}
<div class="rules mt-3">
Deux must secure the existence of our people and a future for dramatic children.
</div>
{% if not v -%}
<hr>
<div class="small pt-2">Already signed in on rDrama on this device?</div>
<a class="btn btn-primary login w-100 mt-3" id="loginshared_button" href="https://rdrama.net/loginshared/auth/deuxrama.net">Sign In with rDrama</a>
{%- endif %}
</div>