forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-02-11 17:02:27 +02:00
parent f326ec34dc
commit 3bc88b8c06
6 changed files with 16 additions and 24 deletions

View File

@ -278,7 +278,7 @@ def submit_contact(v):
body = request.values.get("message")
if not body: abort(400)
body = f'This message has been sent automatically to all admins via [/contact](/contact), user email is "{v.email}"\n\nMessage:\n\n' + body
body = f'This message has been sent automatically to all admins via [/contact](/contact)\n\nMessage:\n\n' + body
body_html = sanitize(body, noimages=True)
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":

View File

@ -7,7 +7,7 @@ from .front import frontlist
valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$")
@app.get("/s/<sub>/mods")
@auth_required
@is_not_permabanned
def mods(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none()
if not sub: abort(404)
@ -18,7 +18,7 @@ def mods(v, sub):
@app.post("/s/<sub>/add_mod")
@auth_required
@is_not_permabanned
def add_mod(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none()
if not sub: abort(404)
@ -43,13 +43,13 @@ def add_mod(v, sub):
@app.get("/create_sub")
@auth_required
@is_not_permabanned
def create_sub(v):
return render_template("sub/create_sub.html", v=v)
@app.post("/create_sub")
@auth_required
@is_not_permabanned
def create_sub2(v):
name = request.values.get('name')
if not name: abort(400)
@ -77,7 +77,7 @@ def create_sub2(v):
return redirect(f'/s/{sub.name}')
@app.post("/kick/<pid>")
@auth_required
@is_not_permabanned
def kick(v, pid):
try: pid = int(pid)
except: abort(400)
@ -97,7 +97,7 @@ def kick(v, pid):
@app.get('/s/<sub>/settings')
@auth_required
@is_not_permabanned
def sub_settings(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
if not sub: abort(404)
@ -109,7 +109,7 @@ def sub_settings(v, sub):
@app.post('/s/<sub>/sidebar')
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
@is_not_permabanned
def post_sub_sidebar(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none()
if not sub: abort(404)
@ -133,7 +133,7 @@ def post_sub_sidebar(v, sub):
@app.post("/s/<sub>/banner")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
@is_not_permabanned
def sub_banner(v, sub):
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
@ -164,7 +164,7 @@ def sub_banner(v, sub):
@app.post("/s/<sub>/sidebar_image")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
@is_not_permabanned
def sub_sidebar(v, sub):
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
@ -190,12 +190,4 @@ def sub_sidebar(v, sub):
g.db.add(sub)
g.db.commit()
return redirect(f'/s/{sub.name}/settings')
#mods id seq
#css
#exile
#guild mod log
#remove mod
#search sub
return redirect(f'/s/{sub.name}/settings')

View File

@ -225,7 +225,7 @@
</a>
{% elif sub %}
<a href="/">
<img alt="sub banner" src="{{sub.banner_url}}" max-height=190px width=100% style="object-fit:cover">
<img alt="/s/{[sub.name]} banner" src="{{sub.banner_url}}" max-height=190px width=100% style="object-fit:cover">
</a>
{% else %}
<a href="/">
@ -276,7 +276,7 @@
{% endblock %}
</div>
{% if home %}
{% if home or sub and (request.path.startswith('/post') or request.path.startswith('/comment')) %}
{% block sidebar %}
{% include "sidebar_" + SITE_NAME + ".html" %}
{% endblock %}

View File

@ -35,7 +35,7 @@
{% set icon = ('marseyblm','marseykween','marseydynamite','marseyblack','marseymyeisha','marseyetika','marseyobama','marseyblackcop','marseysosa','marseyblackface')|random() %}
<img alt="header icon" height=33 src="/static/assets/images/emojis/{{icon}}.webp?a=1008">
{% else %}
<img alt="header icon" height=33 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1010">
<img alt="header icon" height=33 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1011">
{% endif %}
{% if SITE_NAME == 'Drama' %}

View File

@ -57,7 +57,7 @@
<div class="d-flex">
<div class="title w-lg-75 text-md-center">
<img loading="lazy" alt="sub banner" src="{{sub.banner_url}}" class="banner-pic-135">
<img loading="lazy" alt="/s/{[sub.name]} banner" src="{{sub.banner_url}}" class="banner-pic-135">
</div>
<div class="body w-lg-100 my-auto">

View File

@ -296,7 +296,7 @@
{% if p.sub and v.mods(p.sub) %}
<a class="list-inline-item text-danger" role="button" onclick="post_toast('/kick/{{p.id}}')"><i class="fas fa-sign-out text-danger"></i>Kick</a>
<a class="dropdown-item list-inline-item text-danger" role="button" onclick="post_toast('/kick/{{p.id}}')"><i class="fas fa-sign-out text-danger"></i>Kick</a>
{% endif %}