feat(static): update and optimizate

This commit is contained in:
2026-04-24 14:09:14 +03:00
parent c233b020fc
commit 7c57f939c0
26 changed files with 280 additions and 87 deletions

View File

@@ -1,6 +1,7 @@
import datetime
from pathlib import Path
from babel.dates import format_date
from fastapi import APIRouter
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.templating import Jinja2Templates
@@ -20,7 +21,13 @@ templates = Jinja2Templates(
base_dir / "templates",
]
)
templates.env.globals.update({"_": _})
templates.env.globals.update(
{
"_": _,
"version": __version__,
"format_date": format_date,
}
)
templates.env.filters["timedelta_format"] = timedelta_format
router = APIRouter()