diff --git a/maloja/server.py b/maloja/server.py index 69f126c..8bbc001 100644 --- a/maloja/server.py +++ b/maloja/server.py @@ -3,7 +3,6 @@ import sys import os from threading import Thread from importlib import resources -from css_html_js_minify import html_minify, css_minify import datauri import time @@ -44,46 +43,6 @@ webserver = Bottle() -###### -### CSS -##### - - -def generate_css(): - cssstr = "" - with resources.files('maloja') / 'web' / 'static' as staticfolder: - - for file in os.listdir(os.path.join(staticfolder,"css")): - 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"): - with open(os.path.join(data_dir['css'](file)),"r") as filed: - cssstr += filed.read() - - cssstr = css_minify(cssstr) - return cssstr - -css = generate_css() - - - -###### -### MINIFY -##### - -def clean_html(inp): - return inp - - #if malojaconfig["DEV_MODE"]: return inp - #else: return html_minify(inp) - - - - - ###### ### ERRORS @@ -201,13 +160,6 @@ def static_image(pth): return resp -@webserver.route("/style.css") -def get_css(): - response.content_type = 'text/css' - if malojaconfig["DEV_MODE"]: return generate_css() - else: return css - - @webserver.route("/login") def login(): return auth.get_login_page() @@ -216,7 +168,7 @@ def login(): @webserver.route("/.") @webserver.route("/media/.") def static(name,ext): - assert ext in ["txt","ico","jpeg","jpg","png","less","js","ttf"] + assert ext in ["txt","ico","jpeg","jpg","png","less","js","ttf","css"] with resources.files('maloja') / 'web' / 'static' as staticfolder: response = static_file(ext + "/" + name + "." + ext,root=staticfolder) response.set_header("Cache-Control", "public, max-age=3600") @@ -260,7 +212,7 @@ def jinja_page(name): if malojaconfig["DEV_MODE"]: jinja_environment.cache.clear() - return clean_html(res) + return res @webserver.route("/") @auth.authenticated diff --git a/maloja/web/jinja/abstracts/base.jinja b/maloja/web/jinja/abstracts/base.jinja index f0ff337..1c6da0d 100644 --- a/maloja/web/jinja/abstracts/base.jinja +++ b/maloja/web/jinja/abstracts/base.jinja @@ -12,7 +12,7 @@ - + @@ -86,7 +86,7 @@ {% block icon_bar %}{% endblock %} {% include 'icons/settings.jinja' %} - +
diff --git a/maloja/web/static/css/grisons.css b/maloja/web/static/css/grisons.css index 797fced..486fbf1 100644 --- a/maloja/web/static/css/grisons.css +++ b/maloja/web/static/css/grisons.css @@ -2,6 +2,8 @@ COMMON STYLES FOR MALOJA, ALBULA AND POSSIBLY OTHERS **/ +@import url("/grisonsfont.css"); + :root { --base-color: #232327; --base-color-dark: #090909; diff --git a/maloja/web/static/css/maloja.css b/maloja/web/static/css/maloja.css index 5ac3bfb..77733d1 100644 --- a/maloja/web/static/css/maloja.css +++ b/maloja/web/static/css/maloja.css @@ -1,3 +1,6 @@ +@import url("/grisons.css"); + + body { padding:15px; padding-bottom:35px; diff --git a/pyproject.toml b/pyproject.toml index 81ea943..b6f30c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ dependencies = [ #"pyvips>=2.1.16", "jinja2>=2.11", "lru-dict>=1.1.6", - "css_html_js_minify>=2.5.5", "psutil>=5.8.0", "sqlalchemy>=1.4", "python-datauri>=1.1.0",