master
Aevann1 2022-03-26 20:35:44 +02:00
parent 1de350f3e9
commit db1c6b7059
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,7 @@ tiers={
@auth_required
def removebackground(v):
v.background = None
v.theme = 'midnight'
g.db.add(v)
g.db.commit()
return {"message": "Background removed!"}
@ -326,7 +327,10 @@ def settings_profile_post(v):
theme = request.values.get("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
if theme == "win98": v.themecolor = "30409f"
updated = True

View File

@ -115,7 +115,7 @@
<p>Change the theme for the website.</p>
<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')">
{% 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 %}>
{{entry}}
</option>