sfd
This commit is contained in:
parent
4d1cf106b6
commit
77775a1ba0
2 changed files with 6 additions and 2 deletions
|
@ -34,6 +34,7 @@ tiers={
|
||||||
@auth_required
|
@auth_required
|
||||||
def removebackground(v):
|
def removebackground(v):
|
||||||
v.background = None
|
v.background = None
|
||||||
|
v.theme = 'midnight'
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Background removed!"}
|
return {"message": "Background removed!"}
|
||||||
|
@ -326,7 +327,10 @@ def settings_profile_post(v):
|
||||||
|
|
||||||
theme = request.values.get("theme")
|
theme = request.values.get("theme")
|
||||||
if theme:
|
if theme:
|
||||||
if theme in {"dramblr", "classic", "classic_dark", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"}:
|
if theme in {"dramblr", "classic", "classic_dark", "transparent", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"}:
|
||||||
|
if theme == "transparent" and not v.background:
|
||||||
|
return {"error": "You need to set a background to use the transparent theme!"}
|
||||||
|
if theme != "transparent": v.background = None
|
||||||
v.theme = theme
|
v.theme = theme
|
||||||
if theme == "win98": v.themecolor = "30409f"
|
if theme == "win98": v.themecolor = "30409f"
|
||||||
updated = True
|
updated = True
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
<p>Change the theme for the website.</p>
|
<p>Change the theme for the website.</p>
|
||||||
<div class="input-group mb2">
|
<div class="input-group mb2">
|
||||||
<select autocomplete="off" id='theme' class="form-control" form="profile-settings" name="theme" onchange="post_toast(this,'/settings/profile?theme='+document.getElementById('theme').value, '1')">
|
<select autocomplete="off" id='theme' class="form-control" form="profile-settings" name="theme" onchange="post_toast(this,'/settings/profile?theme='+document.getElementById('theme').value, '1')">
|
||||||
{% for entry in ["dramblr", "classic", "classic_dark", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"] %}
|
{% for entry in ["dramblr", "classic", "classic_dark", "transparent", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"] %}
|
||||||
<option value="{{entry}}" {% if v.theme==entry %} selected {% endif %}>
|
<option value="{{entry}}" {% if v.theme==entry %} selected {% endif %}>
|
||||||
{{entry}}
|
{{entry}}
|
||||||
</option>
|
</option>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue