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>
41 lines
1.3 KiB
HTML
41 lines
1.3 KiB
HTML
{{define "head"}}
|
|
<meta name="robots" content="noindex">
|
|
{{end}}
|
|
|
|
{{define "content"}}
|
|
<h1>Administrasjon</h1>
|
|
|
|
{{with .Data}}
|
|
<div class="grid">
|
|
<article>
|
|
<header><strong>Brukere</strong></header>
|
|
<p class="stat">{{.UserCount}}</p>
|
|
<footer><a href="{{basePath}}/admin/users">Administrer brukere</a></footer>
|
|
</article>
|
|
<article>
|
|
<header><strong>Favoritter</strong></header>
|
|
<p class="stat">{{.FaveCount}}</p>
|
|
</article>
|
|
<article>
|
|
<header><strong>Ventende forespørsler</strong></header>
|
|
<p class="stat">{{.PendingCount}}</p>
|
|
{{if gt .PendingCount 0}}
|
|
<footer><a href="{{basePath}}/admin/signup-requests">Se forespørsler</a></footer>
|
|
{{end}}
|
|
</article>
|
|
</div>
|
|
|
|
<nav>
|
|
<ul>
|
|
<li><a href="{{basePath}}/admin/users" role="button" class="outline">Brukere</a></li>
|
|
<li><a href="{{basePath}}/admin/tags" role="button" class="outline">Merkelapper</a></li>
|
|
<li><a href="{{basePath}}/admin/signup-requests" role="button" class="outline">Forespørsler</a></li>
|
|
<li><a href="{{basePath}}/admin/settings" role="button" class="outline">Innstillinger</a></li>
|
|
</ul>
|
|
</nav>
|
|
|
|
{{with .Settings}}
|
|
<p><small>Registreringsmodus: <strong>{{.SignupMode}}</strong></small></p>
|
|
{{end}}
|
|
{{end}}
|
|
{{end}}
|