mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-07-04 09:11:42 +02:00
Add theming
This commit is contained in:
@ -73,7 +73,7 @@ def songlist():
|
||||
@nocache
|
||||
@basic_auth.required
|
||||
def settings():
|
||||
return render_template('settings.html', app=app, auth=basic_auth.authenticate())
|
||||
return render_template('settings.html', app=app, auth=basic_auth.authenticate(), themes=helpers.get_themes())
|
||||
|
||||
|
||||
@app.route("/settings", methods=['POST'])
|
||||
@ -82,6 +82,7 @@ def settings():
|
||||
def settings_post():
|
||||
entryquota = request.form.get("entryquota")
|
||||
maxqueue = request.form.get("maxqueue")
|
||||
theme = request.form.get("theme")
|
||||
if entryquota.isnumeric() and int(entryquota) > 0: # type: ignore
|
||||
app.config['ENTRY_QUOTA'] = int(entryquota) # type: ignore
|
||||
else:
|
||||
@ -90,6 +91,10 @@ def settings_post():
|
||||
app.config['MAX_QUEUE'] = int(maxqueue) # type: ignore
|
||||
else:
|
||||
abort(400)
|
||||
if theme in helpers.get_themes():
|
||||
app.config['THEME'] = theme
|
||||
else:
|
||||
abort(400)
|
||||
|
||||
helpers.persist_config(app=app)
|
||||
|
||||
|
Reference in New Issue
Block a user