chore(ui): add module file and main stub
- chore(ui): add module file and main stub - feat(ui): add layout, pages and partials - feat(ui): add stylesheet and scripts - feat(ui): add page renderer and static file handler - test(ui): cover rendering, escaping and static serving
This commit is contained in:
1 parent
7089a6f408
commit
5ac8f98f10
26 files changed
+3921
No files matched your search
@@ -0,0 +1,82 @@
|
||||
{{- /* SPDX-License-Identifier: GPL-2.0-or-later */ -}}
|
||||
{{- /* Copyright (C) 2026 Bryan Joshua Pedini */ -}}
|
||||
{{define "title"}}User {{.TargetUser}}{{end}}
|
||||
{{define "content"}}<p class="crumbs"><a href="/users">Users</a></p>
|
||||
<div class="page-head">
|
||||
<h1 id="user-title">{{.TargetUser}}</h1>
|
||||
<span class="badge badge-muted" id="user-state" hidden></span>
|
||||
</div>
|
||||
<section class="card" aria-labelledby="user-info-title">
|
||||
<h2 id="user-info-title">Details</h2>
|
||||
<dl class="dl" id="user-summary"></dl>
|
||||
<p class="muted" id="user-status" role="status">Loading...</p>
|
||||
</section>
|
||||
{{if eq .Username .TargetUser}}
|
||||
<section class="card" id="user-self">
|
||||
<p>This is your own account. Role, password and deletion are not available here. <a href="/account">Open your account page</a> to change your password.</p>
|
||||
</section>
|
||||
{{else}}
|
||||
<div id="user-controls" hidden>
|
||||
<section class="card" aria-labelledby="user-role-title">
|
||||
<h2 id="user-role-title">Role</h2>
|
||||
<form class="inline-form" id="role-form" novalidate>
|
||||
<div class="field">
|
||||
<label for="user-role">Role</label>
|
||||
<select id="user-role" name="role">
|
||||
<option value="user">user</option>
|
||||
<option value="admin">admin</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-small">Save role</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card" aria-labelledby="user-password-title">
|
||||
<h2 id="user-password-title">Password</h2>
|
||||
<p class="muted">Setting a password ends every session of this user.</p>
|
||||
<form class="form" id="password-form" novalidate>
|
||||
<div class="field">
|
||||
<label for="up-password">New password</label>
|
||||
<input id="up-password" name="password" type="password" autocomplete="new-password" maxlength="256">
|
||||
<p class="hint">12 to 256 characters.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="up-repeat">Repeat the new password</label>
|
||||
<input id="up-repeat" name="repeat" type="password" autocomplete="new-password" maxlength="256">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit" class="btn btn-small">Set password</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card" aria-labelledby="user-zones-title">
|
||||
<h2 id="user-zones-title">Delegated zones</h2>
|
||||
<ul class="list" id="user-zones"></ul>
|
||||
<p class="muted" id="user-zones-status" role="status"></p>
|
||||
<form class="inline-form" id="zone-add-form" novalidate>
|
||||
<div class="field">
|
||||
<label for="user-zone-pick">Delegate a zone</label>
|
||||
<select id="user-zone-pick" name="zone"></select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-small">Add zone</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card danger-zone" aria-labelledby="user-danger-title">
|
||||
<h2 id="user-danger-title">Danger zone</h2>
|
||||
<p>Deleting the user ends their sessions and prevents them from signing in. The username stays taken and the history of the user stays in the audit.</p>
|
||||
<form class="inline-form" id="user-delete-form" novalidate>
|
||||
<div class="field">
|
||||
<label for="user-delete-confirm">Type the username to confirm</label>
|
||||
<input id="user-delete-confirm" name="confirm" type="text" autocomplete="off" autocapitalize="none" spellcheck="false">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-danger" id="user-delete" disabled>Delete user</button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
<section class="card" id="user-readonly" hidden>
|
||||
<h2>Delegated zones</h2>
|
||||
<ul class="list" id="user-zones-readonly"></ul>
|
||||
</section>
|
||||
{{end}}{{end}}
|
||||
Reference in new issue
Block a user