Added support for themes to procrastinate from actually needed work

This commit is contained in:
krateng 2022-03-18 01:59:47 +01:00
parent 1fff4eca6c
commit cc24d48e65
7 changed files with 67 additions and 3 deletions

View File

@ -370,3 +370,9 @@ def get_backup(**keys):
archivefile = backup(tmpfolder)
return static_file(os.path.basename(archivefile),root=tmpfolder)
@api.post("delete_scrobble")
@authenticated_api
def delete_scrobble(timestamp):
pass

View File

@ -193,7 +193,8 @@ malojaconfig = Configuration(
"use_local_images":(tp.Boolean(), "Use Local Images", True),
#"local_image_rotate":(tp.Integer(), "Local Image Rotate", 3600),
"timezone":(tp.Integer(), "UTC Offset", 0),
"time_format":(tp.String(), "Time Format", "%d. %b %Y %I:%M %p")
"time_format":(tp.String(), "Time Format", "%d. %b %Y %I:%M %p"),
"theme":(tp.String(), "Theme", "maloja")
}
},
configfile=newsettingsfile,

View File

@ -56,8 +56,9 @@ def generate_css():
with resources.files('maloja') / 'web' / 'static' as staticfolder:
for file in os.listdir(os.path.join(staticfolder,"css")):
with open(os.path.join(staticfolder,"css",file),"r") as filed:
cssstr += filed.read()
if file.endswith(".css"):
with open(os.path.join(staticfolder,"css",file),"r") as filed:
cssstr += filed.read()
for file in os.listdir(data_dir['css']()):
if file.endswith(".css"):
@ -214,6 +215,7 @@ def get_css():
def login():
return auth.get_login_page()
# old
@webserver.route("/<name>.<ext>")
@webserver.route("/media/<name>.<ext>")
def static(name,ext):
@ -223,6 +225,14 @@ def static(name,ext):
response.set_header("Cache-Control", "public, max-age=3600")
return response
# new, direct reference
@webserver.route("/static/<path:path>")
def static(path):
with resources.files('maloja') / 'web' / 'static' as staticfolder:
response = static_file(path,root=staticfolder)
response.set_header("Cache-Control", "public, max-age=3600")
return response
### DYNAMIC

View File

@ -11,6 +11,7 @@
<meta name="darkreader" content="wat" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/static/css/themes/{{ settings.theme }}.css" />
<script src="/search.js"></script>
<script src="/neopolitan.js"></script>

View File

@ -0,0 +1,23 @@
:root {
--base-color: #140c12;
--base-color-dark: #080507;
--base-color-light: #2c1b28;
--base-color-accent: #452a3e;
--base-color-accent-dark: #442b3e;
--base-color-accent-light: #dfcad9;
--text-color: #d8b700;
--text-color-selected: fadeout(var(--text-color),40%);
--text-color-secondary: #6a7600;
--text-color-tertiary: #474f00;
--text-color-focus: #3D428B;
--ctrl-element-color-bg: rgba(0,255,255,0.1);
--ctrl-element-color-main: rgba(103,85,0,0.7);
--ctrl-element-color-focus: gold;
--button-color-bg: var(--text-color);
--button-color-bg-focus: var(--text-color-focus);
--button-color-fg: var(--base-color);
--button-color-fg-focus: var(--base-color);
}

View File

@ -0,0 +1,23 @@
:root {
--base-color: #2f3493;
--base-color-dark: #000000;
--base-color-light: #59ebfc;
--base-color-accent: #9821a5;
--base-color-accent-dark: #740C7F;
--base-color-accent-light: #D41BE8;
--text-color: #e5b48f;
--text-color-selected: fadeout(var(--text-color),40%);
--text-color-secondary: #f9f9f9;
--text-color-tertiary: #f7f7f7;
--text-color-focus: #59ebfc;
--ctrl-element-color-bg: rgba(0,255,255,0.1);
--ctrl-element-color-main: rgba(103,85,0,0.7);
--ctrl-element-color-focus: gold;
--button-color-bg: var(--text-color);
--button-color-bg-focus: var(--text-color-focus);
--button-color-fg: var(--base-color);
--button-color-fg-focus: var(--base-color);
}

View File