This commit is contained in:
fabio
2026-02-22 17:47:28 +01:00
parent 722dd85fc6
commit 036aadb09a
18 changed files with 746 additions and 39 deletions

View File

@@ -1,42 +1,40 @@
{{- $flashSuccess := index . "FlashSuccess" -}}
{{- $flashError := index . "FlashError" -}}
{{- $nav := index . "NavSection" -}}
<!doctype html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{index . "Title"}}</title>
<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: 960px; margin: 20px auto; padding: 0 16px; }
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 12px; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
main { background: #fff; border-radius: 10px; padding: 20px; }
.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>
</head>
<body>
<nav>
<a href="/" class="{{if eq $nav "public"}}active{{end}}">Public</a>
<a href="/private" class="{{if eq $nav "private"}}active{{end}}">Private</a>
<a href="/admin" class="{{if eq $nav "admin"}}active{{end}}">Admin</a>
<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">
{{if $flashSuccess}}
<div class="flash success">{{$flashSuccess}}</div>
{{end}}
{{if $flashError}}
<div class="flash error">{{$flashError}}</div>
{{end}}
<main>
{{index . "Content"}}
</main>
{{template "_flash.html" .}}
<div class="card">
{{template "content" .}}
</div>
</div>
</body>
</html>