Add TheMotte theme and make it default.

I created a new theme, "TheMotte" in /assests/css. Someone with any design
skill at all should try improving this. Currently it is a copy of light.css

__main__.py defines the experience for a user without an account. I removed the
check for an OS environment variable, and defaulted to the new theme.

/classes/user.py defines the default for a new account. I removed the check for an OS
environment variable, and defaulted to the new theme.

/routes/settings.py has a list of the themes that checks them for... something.
I added the new one here, just in case.

/templates/settings_profile.html has a hardcoded list that controls which
themes appear in the user settings page. Added the new theme here, so you can
select it.
This commit is contained in:
JamPaladin 2022-05-09 22:29:31 +10:00 committed by GitHub
parent 1ee9c1bfa7
commit 74476d6223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 96 additions and 7 deletions

View file

@ -278,7 +278,9 @@ def settings_profile_post(v):
theme = request.values.get("theme")
if theme:
if theme in {"dramblr", "reddit", "classic", "classic_dark", "transparent", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"}:
if theme in {"TheMotte", "dramblr", "reddit", "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!"}
v.theme = theme