restore "View All Sidebar Images" and "View All Banners" in the directory

master
Aevann 2024-03-06 00:03:32 +02:00
parent eaf1ab4d3d
commit 3d1d52771b
3 changed files with 41 additions and 0 deletions

View File

@ -443,3 +443,22 @@ def donate(v):
@auth_required
def orgy(v):
return redirect("/chat")
@app.get("/sidebar_images")
@app.get("/banners")
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@auth_required
def view_art(v):
if request.path == '/sidebar_images':
location_kind = 'sidebar'
title = "Sidebar Images"
else:
location_kind = 'banners'
title = "Banners"
urls = os.listdir(f'files/assets/images/{SITE_NAME}/{location_kind}')
urls = reversed([f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/{location_kind}/{x}" for x in urls])
return render_template(f'view_art.html', v=v, urls=urls, title=title)

View File

@ -66,6 +66,20 @@
'/post/103085',
SITE == 'rdrama.net',
),
(
'View All Sidebar Images',
'',
'fa-sidebar-flip', '#f5fffa',
'/sidebar_images',
True,
),
(
'View All Banners',
'',
'fa-landscape', '#87cefa',
'/banners',
True,
),
(
'View All Emojis',
'',

View File

@ -0,0 +1,8 @@
{% extends "default.html" %}
{% block pagetitle %}{{title}}{% endblock %}
{% block content %}
<h2 class="mt-4">{{title}}</h2>
{% for url in urls %}
<img class="mt-4 mr-3" style="max-width:80vw" src="{{url}}" loading="lazy">
{% endfor %}
{% endblock %}