rewrite styles

This commit is contained in:
Mateusz Gruszczyński
2026-07-14 11:52:36 +02:00
parent 780681dfd5
commit e200c91881
19 changed files with 220 additions and 65 deletions
+5 -5
View File
@@ -2,7 +2,7 @@ from flask import Flask, request, url_for
import click
import hashlib
from pathlib import Path
from .extensions import db, login_manager, socketio
from .extensions import db, login_manager
from .models import User, AppSetting
from .config import Config
@@ -22,7 +22,7 @@ def _themes(app):
return {
"bootstrap": {"label":"Bootstrap", "url":app.config["THEME_BOOTSTRAP_URL"], "mode":"light"},
"flatly": {"label":"Flatly", "url":app.config["THEME_FLATLY_URL"], "mode":"light"},
"darkly": {"label":"Darkly", "url":app.config["THEME_DARKLY_URL"], "mode":"dark"},
"darkly": {"label":"Ciemny", "url":app.config["THEME_BOOTSTRAP_URL"], "mode":"dark"},
"pulse": {"label":"Pulse", "url":app.config["THEME_PULSE_URL"], "mode":"light"},
}
@@ -31,7 +31,7 @@ def create_app(test_config=None):
app = Flask(__name__)
app.config.from_object(Config)
if test_config: app.config.update(test_config)
db.init_app(app); login_manager.init_app(app); socketio.init_app(app)
db.init_app(app); login_manager.init_app(app)
from .database import prepare_database
prepare_database(app)
@@ -57,7 +57,7 @@ def create_app(test_config=None):
else:
response.headers["Cache-Control"] = "public, max-age=2592000, immutable"
elif response.mimetype == "text/html":
response.headers["Cache-Control"] = "no-store, no-cache, private, must-revalidate"
response.headers["Cache-Control"] = "no-store, private, must-revalidate"
return response
@login_manager.user_loader
@@ -86,7 +86,7 @@ def create_app(test_config=None):
theme_name = record.value if record and record.value in themes else "bootstrap"
return {"app_theme": themes[theme_name], "app_theme_name": theme_name, "themes": themes,
"asset_urls": {"bootstrap_js": app.config["BOOTSTRAP_JS_URL"], "choices_css": app.config["CHOICES_CSS_URL"],
"choices_js": app.config["CHOICES_JS_URL"], "chart_js": app.config["CHART_JS_URL"], "socket_io_js": app.config["SOCKET_IO_JS_URL"]}}
"choices_js": app.config["CHOICES_JS_URL"], "chart_js": app.config["CHART_JS_URL"]}}
@app.get("/health")
def health(): return {"status":"ok"}