Files
DoGaMa-serv/internal/web/templates/account.html
T
codex 39a33556d6
CI / validate (pull_request) Successful in 26m0s
chore(code): improve source readability
2026-08-15 23:09:59 +02:00

151 lines
5.1 KiB
HTML

{{define "account.html"}}
<!doctype html>
<html lang="{{.Language}}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>
Settings · DoGaMa
</title>
<link rel="stylesheet" href="/static/app.v1.css">
</head>
<body class="app-body">
{{template "sidebar" .}}
<main class="app-main">
<div class="page-heading">
<h1>
Settings
</h1>
<p>
Personal account preferences.
</p>
</div>
<nav class="tabs">
<a href="#profile">
Profile
</a>
<a href="#security">
Security
</a>
<a href="#language">
Language
</a>
<a href="#notifications">
Notifications
</a>
</nav>
<section class="panel settings-section" id="profile">
<h2>
Profile
</h2>
<p>
Signed in as
<strong>
{{.User.Username}}
</strong>
.
</p>
<form method="post" action="/account/email">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<label>
Email
<input name="email" type="email" value="{{.User.Email}}" required autocomplete="email">
</label>
<button type="submit">
Save email
</button>
</form>
</section>
<section class="panel settings-section" id="security">
<h2>
Security
</h2>
<form method="post" action="/account/password">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<label>
Current password
<input name="current_password" type="password" required autocomplete="current-password">
</label>
<label>
New password
<input name="new_password" type="password" required minlength="12" autocomplete="new-password">
</label>
<label>
Confirm new password
<input name="confirm_password" type="password" required minlength="12" autocomplete="new-password">
</label>
<button type="submit">
Change password
</button>
</form>
</section>
<section class="panel settings-section" id="language">
<h2>
Language
</h2>
<form method="post" action="/account/language">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<label>
Language
<select name="language">
{{range .Languages}}
<option value="{{.Code}}"{{if eq $.Language .Code}} selected{{end}}>
{{.Display}}
</option>
{{end}}
</select>
</label>
<button type="submit">
Save language
</button>
</form>
</section>
<section class="panel settings-section" id="notifications">
<h2>
Email notifications
</h2>
<p>
Important failures are enabled by default. Routine start, stop and backup messages are disabled until you opt in.
</p>
<form method="post" action="/account/notifications">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<label class="check">
<input type="checkbox" name="server_start"{{if index .NotificationPreferences "server_start"}} checked{{end}}>
Server started
</label>
<label class="check">
<input type="checkbox" name="server_stop"{{if index .NotificationPreferences "server_stop"}} checked{{end}}>
Server stopped
</label>
<label class="check">
<input type="checkbox" name="server_error"{{if index .NotificationPreferences "server_error"}} checked{{end}}>
Server errors
</label>
<label class="check">
<input type="checkbox" name="backup"{{if index .NotificationPreferences "backup"}} checked{{end}}>
Backups
</label>
<label class="check">
<input type="checkbox" name="restore"{{if index .NotificationPreferences "restore"}} checked{{end}}>
Restores
</label>
<label class="check">
<input type="checkbox" name="update"{{if index .NotificationPreferences "update"}} checked{{end}}>
Updates
</label>
<label class="check">
<input type="checkbox" name="administration"{{if index .NotificationPreferences "administration"}} checked{{end}}>
Important administrative actions
</label>
<button type="submit">
Save notification preferences
</button>
</form>
</section>
</main>
<script src="/static/app.v2.js">
</script>
</body>
</html>
{{end}}