Files
Onyscribe-Admin/app/templating.py
RubenRWU 7d8c226da2 Onyscribe Admin: Initialer Stand
Admin-Plattform für die Tenants von Onyscribe: Editor mit Live-Vorschau (echter Core in Sandbox), Versionen, KI-Agent (Cortecs),
OIDC-Abgleich über die Login-Developer-API, Deploy-Engine (Mittwald, gesperrt ohne DEPLOY_LIVE, Freigabe pro Tenant),
Core-Vertrag (Schema/Manifest), Core-Releases mit Kompatibilitätsprüfung, Canary-Rollout und Rollback, Zustandsabgleich.
Runbook: docs/RUNBOOK_PARALLELTEST.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 15:30:26 +02:00

33 lines
788 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from __future__ import annotations
from datetime import datetime
from zoneinfo import ZoneInfo
from fastapi.templating import Jinja2Templates
from app.settings import APP_NAME, ROOT
templates = Jinja2Templates(directory=str(ROOT / "app" / "templates"))
BERLIN = ZoneInfo("Europe/Berlin")
def dt(value: datetime | None, fmt: str = "%d.%m.%Y %H:%M") -> str:
if not value:
return "–"
if value.tzinfo is None:
from datetime import timezone
value = value.replace(tzinfo=timezone.utc)
return value.astimezone(BERLIN).strftime(fmt)
templates.env.filters["dt"] = dt
templates.env.globals["APP_NAME"] = APP_NAME
def _live() -> bool:
from app.services import deploy
return deploy.live_enabled()
templates.env.globals["deploy_live"] = _live