* remove backgrounds (fixes #379) * remove UI elements * remove gif modals lol * . * remove unused gif modal. * add alembic migration
This commit is contained in:
parent
7aa3dc373e
commit
56087f889e
11 changed files with 43 additions and 291 deletions
|
@ -22,26 +22,13 @@ tiers={
|
|||
"(LlamaBean)": 1,
|
||||
}
|
||||
|
||||
@app.post("/settings/removebackground")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def removebackground(v):
|
||||
v.background = None
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
return {"message": "Background removed!"}
|
||||
|
||||
@app.post("/settings/profile")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def settings_profile_post(v):
|
||||
updated = False
|
||||
|
||||
if request.values.get("background", v.background) != v.background:
|
||||
updated = True
|
||||
v.background = request.values.get("background")
|
||||
|
||||
elif request.values.get("reddit", v.reddit) != v.reddit:
|
||||
if request.values.get("reddit", v.reddit) != v.reddit:
|
||||
reddit = request.values.get("reddit")
|
||||
if reddit in {'old.reddit.com', 'reddit.com', 'i.reddit.com', 'teddit.net', 'libredd.it', 'unddit.com'}:
|
||||
updated = True
|
||||
|
@ -226,10 +213,11 @@ def settings_profile_post(v):
|
|||
theme = request.values.get("theme")
|
||||
if theme:
|
||||
if theme in THEMES:
|
||||
if theme == "transparent" and not v.background:
|
||||
abort(400, "You need to set a background to use the transparent theme!")
|
||||
v.theme = theme
|
||||
if theme == "win98": v.themecolor = "30409f"
|
||||
if theme == "win98":
|
||||
v.themecolor = "30409f"
|
||||
else:
|
||||
v.themecolor = "fff"
|
||||
updated = True
|
||||
else: abort(400)
|
||||
|
||||
|
@ -285,7 +273,6 @@ def changelogsub(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def namecolor(v):
|
||||
|
||||
color = str(request.values.get("color", "")).strip()
|
||||
if color.startswith('#'): color = color[1:]
|
||||
if len(color) != 6: return render_template("settings_security.html", v=v, error="Invalid color code")
|
||||
|
@ -298,7 +285,6 @@ def namecolor(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def themecolor(v):
|
||||
|
||||
themecolor = str(request.values.get("themecolor", "")).strip()
|
||||
if themecolor.startswith('#'): themecolor = themecolor[1:]
|
||||
if len(themecolor) != 6: return render_template("settings_security.html", v=v, error="Invalid color code")
|
||||
|
@ -311,7 +297,6 @@ def themecolor(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def titlecolor(v):
|
||||
|
||||
titlecolor = str(request.values.get("titlecolor", "")).strip()
|
||||
if titlecolor.startswith('#'): titlecolor = titlecolor[1:]
|
||||
if len(titlecolor) != 6: return render_template("settings_profile.html", v=v, error="Invalid color code")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue