From cfb746ebec5bb8381cd720cb2884ce59da585de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Fri, 15 May 2026 12:50:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D1=81=D0=B8=D0=B8=20js=20=D0=B8=20css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 20 +++++++++----------- templates/match_workspace.html | 6 +++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app.py b/app.py index f900b24..4f6c3d5 100644 --- a/app.py +++ b/app.py @@ -311,18 +311,15 @@ def root(request: Request): return RedirectResponse(url="/admin/matches") return RedirectResponse(url="/login") -@app.context_processor -def inject_static_version(): - def static_version(filename): - path = os.path.join(app.root_path, "static", filename) - try: - return int(os.path.getmtime(path)) - except OSError: - return "1" - - return dict(static_version=static_version) - +def static_version(filename: str) -> str: + path = Path(__file__).parent / "static" / filename + try: + return str(int(os.path.getmtime(path))) + except OSError: + return "1" + + def log_action( request: Request, action: str, @@ -642,6 +639,7 @@ def session_workspace( return templates.TemplateResponse( name="match_workspace.html", request=request, + static_version = static_version, context={ "session": session_row, "tab": tab, diff --git a/templates/match_workspace.html b/templates/match_workspace.html index 52d4b89..d6f917d 100644 --- a/templates/match_workspace.html +++ b/templates/match_workspace.html @@ -10,9 +10,9 @@ ЖФЛ Управление vMix - + + -