lavender/pages/manage-users.go.html

72 lines
2.4 KiB
HTML
Raw Permalink Normal View History

2024-02-07 01:18:17 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{.ServiceName}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/assets/style.css">
2024-02-07 01:18:17 +00:00
</head>
<body>
{{template "header.go.html" .}}
2024-02-07 01:18:17 +00:00
<main>
<form method="GET" action="/">
<button type="submit">Home</button>
</form>
<h2>Manage Users</h2>
{{if eq (len .Users) 0}}
<div>No users found, this is definitely a bug.</div>
2024-02-07 01:18:17 +00:00
{{else}}
<table>
<thead>
<tr>
<th>Subject</th>
<th>Email</th>
<th>Email Verified</th>
<th>Roles</th>
<th>Last Updated</th>
<th>Active</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{range .Users}}
2024-02-07 01:18:17 +00:00
<tr>
<td>{{.Subject}}</td>
<th>
{{if $.EmailShow}}
<span>{{.Email}}</span>
{{else}}
<span>{{emailHide .Email}}</span>
{{end}}
</th>
<th>{{.EmailVerified}}</th>
<th>{{.Roles}}</th>
<th>{{.UpdatedAt}}</th>
<td>{{.Active}}</td>
<td>
<form method="GET" action="/manage/users">
<input type="hidden" name="offset" value="{{$.Offset}}"/>
<input type="hidden" name="edit" value="{{.Subject}}"/>
<button type="submit">Edit</button>
</form>
<form method="POST" action="/reset-password">
<input type="hidden" name="email" value="{{.Email}}"/>
<button type="submit">Send Reset Password Email</button>
</form>
</td>
2024-02-07 01:18:17 +00:00
</tr>
{{end}}
</tbody>
</table>
<form method="GET" action="/manage/users">
<input type="hidden" name="offset" value="{{.Offset}}"/>
{{if not .EmailShow}}
<input type="hidden" name="show-email"/>
{{end}}
<button type="submit">{{if .EmailShow}}Hide Email Addresses{{else}}Show email addresses{{end}}</button>
</form>
2024-02-07 01:18:17 +00:00
{{end}}
</main>
</body>
</html>