This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/server/pages/templates/admin/users.html
2026-03-14 16:46:16 +00:00

49 lines
1.9 KiB
HTML

{{/* Admin users — user management table. */}}
{{define "admin-users"}}
<div class="admin-page">
<h2>Users</h2>
<p class="section-hint">Manage user accounts, roles, and access.</p>
<div class="admin-toolbar">
<input type="text" class="admin-search" id="userSearch" placeholder="Filter users…" oninput="Pages.filterUsers(this.value)">
</div>
{{if .Data.Users}}
<table class="admin-table" id="userTable">
<thead>
<tr>
<th>Username</th>
<th>Email</th>
<th>Display Name</th>
<th>Role</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
{{range .Data.Users}}
<tr data-name="{{.Username}} {{.Email}} {{.DisplayName}}">
<td><strong>{{.Username}}</strong></td>
<td style="color:var(--text-secondary);">{{.Email}}</td>
<td>{{.DisplayName}}</td>
<td><span class="admin-badge admin-badge-{{.Role}}">{{.Role}}</span></td>
<td><span class="admin-badge admin-badge-{{if .IsActive}}active{{else}}inactive{{end}}">{{if .IsActive}}active{{else}}inactive{{end}}</span></td>
<td>
<button class="btn-small" onclick="sb.call('Pages.editUserRole','{{.ID}}','{{.Username}}','{{.Role}}')">Role</button>
{{if .IsActive}}
<button class="btn-small" onclick="sb.call('Pages.toggleUser','{{.ID}}',false)">Disable</button>
{{else}}
<button class="btn-small" onclick="sb.call('Pages.toggleUser','{{.ID}}',true)">Enable</button>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<div class="empty-hint">No users found.</div>
{{end}}
</div>
{{end}}