favoritter/web/templates/pages/admin_settings.html
Ole-Morten Duesund 13aec5be6e feat: add admin panel with user, tag, and signup management
Phase 4 — Admin Panel:
- Admin dashboard with user/fave/pending-request counts
- User management: create with temp password, reset password,
  enable/disable accounts (prevents self-disable)
- Tag management: rename and delete tags
- Signup request management: approve (creates user with
  must-reset-password) and reject pending requests
- Site settings: site name, description, signup mode
  (open/requests/closed)
- All admin routes require both login and admin role
- SignupRequest model and full store (create, list pending,
  approve with user creation, reject)
- SetMustResetPassword method on UserStore for admin password resets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:09:30 +02:00

48 lines
1.6 KiB
HTML

{{define "head"}}
<meta name="robots" content="noindex">
{{end}}
{{define "content"}}
<h1>Nettstedsinnstillinger</h1>
{{with .Data}}{{with .Settings}}
<article>
<form method="POST" action="{{basePath}}/admin/settings">
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}">
<label for="site_name">
Nettstedsnavn
<input type="text" id="site_name" name="site_name"
value="{{.SiteName}}" required>
</label>
<label for="site_description">
Beskrivelse
<textarea id="site_description" name="site_description"
rows="3">{{.SiteDescription}}</textarea>
</label>
<fieldset>
<legend>Registreringsmodus</legend>
<label>
<input type="radio" name="signup_mode" value="open"
{{if eq .SignupMode "open"}}checked{{end}}>
Åpen — alle kan registrere seg
</label>
<label>
<input type="radio" name="signup_mode" value="requests"
{{if eq .SignupMode "requests"}}checked{{end}}>
Forespørsler — nye brukere må godkjennes
</label>
<label>
<input type="radio" name="signup_mode" value="closed"
{{if eq .SignupMode "closed"}}checked{{end}}>
Stengt — ingen nye registreringer
</label>
</fieldset>
<button type="submit">Lagre innstillinger</button>
</form>
</article>
{{end}}{{end}}
{{end}}