M mousikofidi/mousikofidi.py => mousikofidi/mousikofidi.py +10 -0
@@ 44,6 44,7 @@ THEMES = {
"dark": "/css/water/dark.standalone",
"light": "/css/water/light.standalone",
"nes": "/css/nes/nes",
+ "terminal": "/css/terminal",
}
try:
@@ 1119,6 1120,15 @@ def serve_file(path):
@app.route("/settings")
def settings():
c = request_context(app.fidiConfig)
+
+ themes = []
+ for theme in THEMES.keys():
+ if theme == "nes":
+ themes.append({"name": theme, "proper": theme.upper()})
+ else:
+ themes.append({"name": theme, "proper": theme.capitalize()})
+
+ c["themes"] = themes
c["page_name"] = "Settings"
return render_template("settings.html", **c)
M mousikofidi/templates/settings.html => mousikofidi/templates/settings.html +3 -3
@@ 6,9 6,9 @@
<form class="center" id="theme-picker" action="{{ url_for('.settings_edit') }}" method="post">
<label>{% if icons %}<i class="fas fa-palette"></i> {% endif %}Select your theme:
<select class="center" name="theme">
- <option value="dark"{% if "dark" in theme %} selected{% endif %}>Dark</option>
- <option value="light"{% if "light" in theme %} selected{% endif %}>Light</option>
- <option value="nes"{% if "nes" in theme %} selected{% endif %}>NES</option>
+ {% for t in themes %}
+ <option value="{{ t.name }}"{% if t.name in theme %} selected{% endif %}>{{ t.proper }}</option>
+ {% endfor %}
</select>
<input style="margin:0 auto; margin-top:10px;" class="center" type="submit" value="Submit">
</label>