60 lines
2.3 KiB
Python
60 lines
2.3 KiB
Python
"""Shared page shell for the ClientFlow admin UI."""
|
|
from __future__ import annotations
|
|
|
|
from fastapi.responses import HTMLResponse
|
|
|
|
from app.admin_ui.components import esc
|
|
from app.admin_ui.navigation import nav
|
|
from app.admin_ui.styles import ADMIN_UI_V451_CSS
|
|
|
|
|
|
def layout(title: str, subtitle: str, body: str, active: str = "") -> HTMLResponse:
|
|
html_doc = f"""
|
|
<!doctype html>
|
|
<html lang="pt">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{esc(title)} · ClientFlow</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
|
|
<style>{ADMIN_UI_V451_CSS}</style>
|
|
</head>
|
|
<body>
|
|
<div class="cf-app">
|
|
{nav(active)}
|
|
<div class="cf-content">
|
|
<header class="cf-topbar">
|
|
<div class="cf-topbar-left">
|
|
<button class="cf-menu-dot" type="button" title="Menu">☰</button>
|
|
<form class="cf-global-search" action="/opportunities" method="get" role="search">
|
|
<span>⌕</span>
|
|
<input name="q" type="search" placeholder="Pesquisar cliente, NIF, oportunidade, documento ou email…" aria-label="Pesquisar">
|
|
</form>
|
|
</div>
|
|
<div class="cf-topbar-actions" aria-label="Ações rápidas">
|
|
<a class="cf-pill cf-date" href="/operations">Hoje · Centro de trabalho</a>
|
|
<a class="cf-icon-btn" href="/tasks?status=pending&route=rever" title="Revisão">?</a>
|
|
<a class="cf-icon-btn" href="/outbox" title="Outbox">↗</a>
|
|
<a class="cf-pill" href="/system/health">CF</a>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="cf-page">
|
|
<div class="cf-page-title">
|
|
<div>
|
|
<h1>{esc(title)}</h1>
|
|
<p>{esc(subtitle)}</p>
|
|
</div>
|
|
</div>
|
|
{body}
|
|
</main>
|
|
</div>
|
|
</div>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
|
</body>
|
|
</html>
|
|
"""
|
|
return HTMLResponse(html_doc)
|