prompt 6
This commit is contained in:
@@ -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>
|
||||
|
||||
6
web/templates/public/_flash.html
Normal file
6
web/templates/public/_flash.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{if .FlashSuccess}}
|
||||
<div style="background:#dcfce7;color:#166534;padding:12px;border-radius:8px;margin:0 0 12px;">{{.FlashSuccess}}</div>
|
||||
{{end}}
|
||||
{{if .FlashError}}
|
||||
<div style="background:#fee2e2;color:#991b1b;padding:12px;border-radius:8px;margin:0 0 12px;">{{.FlashError}}</div>
|
||||
{{end}}
|
||||
9
web/templates/public/forgot_password.html
Normal file
9
web/templates/public/forgot_password.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{define "content"}}
|
||||
<h1>Password dimenticata</h1>
|
||||
<p class="muted">Inserisci la tua email. Se l'account esiste e risulta verificato, invieremo un link di reset.</p>
|
||||
<form action="/forgot-password" method="post">
|
||||
<label>Email</label>
|
||||
<input type="email" name="email" value="{{.Email}}" required>
|
||||
<button type="submit">Invia link reset</button>
|
||||
</form>
|
||||
{{end}}
|
||||
9
web/templates/public/home.html
Normal file
9
web/templates/public/home.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{define "content"}}
|
||||
<h1>Trustcontact</h1>
|
||||
<p class="muted">Boilerplate GoFiber + HTMX + Svelte CE + GORM.</p>
|
||||
<div class="row">
|
||||
<a href="/signup">Crea account</a>
|
||||
<a href="/login">Accedi</a>
|
||||
<a href="/forgot-password">Password dimenticata</a>
|
||||
</div>
|
||||
{{end}}
|
||||
11
web/templates/public/login.html
Normal file
11
web/templates/public/login.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{define "content"}}
|
||||
<h1>Login</h1>
|
||||
<form action="/login" method="post">
|
||||
<label>Email</label>
|
||||
<input type="email" name="email" value="{{.Email}}" required>
|
||||
<label>Password</label>
|
||||
<input type="password" name="password" required>
|
||||
<button type="submit">Accedi</button>
|
||||
</form>
|
||||
<p class="muted">Non hai un account? <a href="/signup">Registrati</a></p>
|
||||
{{end}}
|
||||
12
web/templates/public/reset_password.html
Normal file
12
web/templates/public/reset_password.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{define "content"}}
|
||||
<h1>Reset password</h1>
|
||||
{{if .Token}}
|
||||
<form action="/reset-password?token={{.Token}}" method="post">
|
||||
<label>Nuova password</label>
|
||||
<input type="password" name="password" required>
|
||||
<button type="submit">Aggiorna password</button>
|
||||
</form>
|
||||
{{else}}
|
||||
<p class="muted">Token mancante o non valido.</p>
|
||||
{{end}}
|
||||
{{end}}
|
||||
11
web/templates/public/signup.html
Normal file
11
web/templates/public/signup.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{define "content"}}
|
||||
<h1>Sign up</h1>
|
||||
<form action="/signup" method="post">
|
||||
<label>Email</label>
|
||||
<input type="email" name="email" value="{{.Email}}" required>
|
||||
<label>Password</label>
|
||||
<input type="password" name="password" required>
|
||||
<button type="submit">Crea account</button>
|
||||
</form>
|
||||
<p class="muted">Hai già un account? <a href="/login">Accedi</a></p>
|
||||
{{end}}
|
||||
6
web/templates/public/verify_notice.html
Normal file
6
web/templates/public/verify_notice.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{define "content"}}
|
||||
<h1>Verifica email</h1>
|
||||
<p class="muted">Controlla la casella di posta e apri il link di verifica ricevuto.</p>
|
||||
<p class="muted">Se il link è scaduto, ripeti la registrazione o contatta supporto.</p>
|
||||
<p><a href="/login">Vai al login</a></p>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user