backend-server-v2/web/templates/layout.html

42 lines
1.7 KiB
HTML

<!doctype html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{.Title}}</title>
<style>
body { font-family: system-ui, sans-serif; margin: 0; background: #f5f7fb; color: #1f2937; }
nav { background: #111827; color: #fff; padding: 12px 16px; display: flex; gap: 12px; }
nav a { color: #e5e7eb; text-decoration: none; }
nav a.active { color: #fff; font-weight: 600; }
.container { max-width: 920px; margin: 20px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 10px; padding: 20px; }
form { display: grid; gap: 10px; max-width: 420px; }
input { padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; }
button { padding: 10px 14px; border: 0; border-radius: 8px; background: #111827; color: #fff; cursor: pointer; }
.muted { color: #6b7280; font-size: 0.95rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
</style>
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
</head>
<body>
<nav>
<a href="/" class="{{if eq .NavSection "public"}}active{{end}}">Public</a>
<a href="/private" class="{{if eq .NavSection "private"}}active{{end}}">Private</a>
<a href="/admin" class="{{if eq .NavSection "admin"}}active{{end}}">Admin</a>
{{if .CurrentUser}}
<form action="/logout" method="post" style="margin-left:auto;">
<button type="submit">Logout</button>
</form>
{{end}}
</nav>
<div class="container">
{{template "_flash.html" .}}
<div class="card">
{{template "content" .}}
</div>
</div>
</body>
</html>