internal/web/templates/adminusers.html
67 lines · 3414 bytes
1{{define "width"}}bounded{{end}}
2{{define "title"}}accounts · admin · {{.Site}}{{end}}
3{{define "content"}}
4<h1>Accounts</h1>
5<p class="meta"><a href="/admin">Admin</a> · the same read as <code>gitbay admin user list</code>.</p>
6{{if .Notice}}<p class="notice" role="status">{{.Notice}}</p>{{end}}
7
8<nav class="filters">
9 <a {{if eq .State "all"}}class="active" aria-current="page" {{end}}href="?state=all">all</a>
10 <a {{if eq .State "active"}}class="active" aria-current="page" {{end}}href="?state=active">active</a>
11 <a {{if eq .State "pending"}}class="active" aria-current="page" {{end}}href="?state=pending">pending</a>
12 <a {{if eq .State "disabled"}}class="active" aria-current="page" {{end}}href="?state=disabled">disabled</a>
13 <a {{if eq .State "admin"}}class="active" aria-current="page" {{end}}href="?state=admin">admins</a>
14</nav>
15
16{{if .Users}}<div class="tablewrap"><table class="keys accounts">
17<thead><tr class="cols"><th>Account</th><th>State</th><th>Created</th><th>Last seen</th><th>Actions</th></tr></thead>
18<tbody>
19{{range .Users}}<tr>
20 <td><a href="/{{.Username}}">{{.Username}}</a>{{if .Admin}} <span class="chip">admin</span>{{end}}</td>
21 <td><span class="chip {{if eq .State "active"}}chip-open{{else if eq .State "disabled"}}chip-closed{{else}}chip-neutral{{end}}">{{.State}}</span></td>
22 <td>{{when .CreatedAt}}</td>
23 <td>{{if .LastSeen}}{{when .LastSeen}}{{else}}never{{end}}</td>
24 <td>
25 {{if .Admin}}
26 <form method="post" action="/admin/users" class="actions">
27 <input type="hidden" name="field" value="demote">
28 <input type="hidden" name="user" value="{{.Username}}">
29 <input type="hidden" name="state" value="{{$.State}}">
30 {{template "confirmfield" .Username}} <button type="submit" class="btn">Demote</button>
31 </form>
32 {{else if eq .State "active"}}
33 <form method="post" action="/admin/users" class="actions">
34 <input type="hidden" name="field" value="promote">
35 <input type="hidden" name="user" value="{{.Username}}">
36 <input type="hidden" name="state" value="{{$.State}}">
37 <button type="submit" class="btn">Promote</button>
38 </form>
39 {{end}}
40 {{if eq .State "disabled"}}
41 <form method="post" action="/admin/users" class="actions">
42 <input type="hidden" name="field" value="enable">
43 <input type="hidden" name="user" value="{{.Username}}">
44 <input type="hidden" name="state" value="{{$.State}}">
45 <button type="submit" class="btn">Enable</button>
46 </form>
47 {{else}}
48 <form method="post" action="/admin/users" class="actions">
49 <input type="hidden" name="field" value="disable">
50 <input type="hidden" name="user" value="{{.Username}}">
51 <input type="hidden" name="state" value="{{$.State}}">
52 {{template "confirmfield" .Username}} <button type="submit" class="btn">Disable</button>
53 </form>
54 {{end}}
55 </td>
56</tr>
57{{end}}
58</tbody></table></div>{{else}}<p class="none">No account matches</p>{{end}}
59{{if .Next}}<p class="pager"><a href="{{.Next}}">more →</a></p>{{end}}
60
61<p class="meta">Creating and deleting an account, issuing an invite and
62asserting an address stay on the command line: each takes a key, mints
63a credential, or cannot be undone.</p>
64<pre tabindex="0"><code>gitbay admin user create <name> --key - < key.pub
65gitbay admin user delete <name> --yes
66gitbay admin invite --email <address></code></pre>
67{{end}}