2026-06-09 00:41:27 +00:00
|
|
|
from fastapi import APIRouter, Request
|
|
|
|
|
from fastapi.templating import Jinja2Templates
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
router = APIRouter(tags=["settings"])
|
|
|
|
|
|
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
|
|
|
|
templates = Jinja2Templates(directory=str(BASE_DIR / "templates"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.get("/settings")
|
|
|
|
|
async def settings_page(request: Request, tab: str = "email"):
|
2026-06-23 10:04:23 +00:00
|
|
|
allowed = ("email", "general", "permissions", "social", "ai")
|
2026-06-09 00:41:27 +00:00
|
|
|
return templates.TemplateResponse(
|
|
|
|
|
"settings.html",
|
|
|
|
|
{
|
|
|
|
|
"request": request,
|
|
|
|
|
"page_title": "Settings",
|
|
|
|
|
"active_tab": tab if tab in allowed else "email",
|
|
|
|
|
},
|
|
|
|
|
)
|