mirror of
https://github.com/krateng/maloja.git
synced 2025-04-14 16:07:13 +03:00
Added support for themes to procrastinate from actually needed work
This commit is contained in:
parent
1fff4eca6c
commit
cc24d48e65
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
23
maloja/web/static/css/themes/constantinople.css
Normal file
23
maloja/web/static/css/themes/constantinople.css
Normal 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);
|
||||
}
|
23
maloja/web/static/css/themes/kda.css
Normal file
23
maloja/web/static/css/themes/kda.css
Normal 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);
|
||||
}
|
0
maloja/web/static/css/themes/maloja.css
Normal file
0
maloja/web/static/css/themes/maloja.css
Normal file
Loading…
x
Reference in New Issue
Block a user