restore "View All Sidebar Images" and "View All Banners" in the directory
parent
eaf1ab4d3d
commit
3d1d52771b
|
@ -443,3 +443,22 @@ def donate(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def orgy(v):
|
def orgy(v):
|
||||||
return redirect("/chat")
|
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)
|
||||||
|
|
|
@ -66,6 +66,20 @@
|
||||||
'/post/103085',
|
'/post/103085',
|
||||||
SITE == 'rdrama.net',
|
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 All Emojis',
|
||||||
'',
|
'',
|
||||||
|
|
|
@ -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 %}
|
Loading…
Reference in New Issue