increase charlimit for hole css
parent
593b74c969
commit
cec08c9e55
|
@ -358,15 +358,16 @@ def post_sub_css(v, sub):
|
|||
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
|
||||
css = request.values.get('css', '').strip()
|
||||
|
||||
if not sub:
|
||||
abort(404)
|
||||
if not v.mods(sub.name):
|
||||
abort(403)
|
||||
if not sub: abort(404)
|
||||
if not v.mods(sub.name): abort(403)
|
||||
|
||||
if len(css) > 6000:
|
||||
error = "CSS is too long (max 6000 characters)"
|
||||
return render_template('sub/settings.html', v=v, sidebar=sub.sidebar, sub=sub, error=error)
|
||||
|
||||
valid, error = validate_css(css)
|
||||
if not valid:
|
||||
return render_template('sub/settings.html',
|
||||
v=v, sidebar=sub.sidebar, sub=sub, error=error)
|
||||
return render_template('sub/settings.html', v=v, sidebar=sub.sidebar, sub=sub, error=error)
|
||||
|
||||
sub.css = css
|
||||
g.db.add(sub)
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
<div class="w-lg-100">
|
||||
<form id="css" action="/h/{{sub.name}}/css" method="post">
|
||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<textarea autocomplete="off" maxlength="4000" class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Enter css here..." rows="10" name="css" form="css">{% if sub.css %}{{sub.css}}{% endif %}</textarea>
|
||||
<textarea autocomplete="off" maxlength="6000" class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Enter css here..." rows="10" name="css" form="css">{% if sub.css %}{{sub.css}}{% endif %}</textarea>
|
||||
|
||||
<div class="d-flex mt-2">
|
||||
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" onclick="disable(this)" value="Save">
|
||||
|
|
|
@ -718,7 +718,7 @@ CREATE TABLE public.subs (
|
|||
sidebar_html character varying(20000),
|
||||
sidebarurl character varying(60),
|
||||
bannerurl character varying(60),
|
||||
css character varying(4000)
|
||||
css character varying(6000)
|
||||
);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue