Files
at-container-registry/pkg/hold/admin/templates/pages/crew.html
T
2026-01-17 15:48:40 -06:00

84 lines
3.4 KiB
HTML

{{define "pages/crew.html"}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.Title}} - Hold Admin</title>
<script src="/admin/public/js/htmx.min.js"></script>
<script src="/admin/public/js/lucide.min.js"></script>
<link rel="stylesheet" href="/admin/public/css/admin.css">
</head>
<body>
{{template "nav" .}}
<main class="container">
{{if .Flash}}
<div class="flash flash-{{.Flash.Category}}">{{.Flash.Message}}</div>
{{end}}
<div class="page-header">
<h1>Crew Management</h1>
<a href="/admin/crew/add" class="btn btn-primary">
<i data-lucide="user-plus"></i>
Add Crew Member
</a>
</div>
{{if .Crew}}
<table class="table">
<thead>
<tr>
<th>Member</th>
<th>Role</th>
<th>Permissions</th>
<th>Tier</th>
<th>Usage</th>
<th>Added</th>
<th class="actions-header">Actions</th>
</tr>
</thead>
<tbody id="crew-list">
{{range .Crew}}
<tr id="crew-{{.RKey}}">
<td class="member-cell">
{{if .Handle}}<strong>{{.Handle}}</strong><br>{{end}}
<code class="did-code">{{.DID}}</code>
</td>
<td>{{.Role}}</td>
<td class="permissions-cell">{{range .Permissions}}<span class="badge">{{.}}</span>{{end}}</td>
<td><span class="badge badge-tier">{{.Tier}}</span><br><small class="tier-limit">{{.TierLimit}}</small></td>
<td>
<div class="usage-cell">
<span>{{.UsageHuman}}</span>
<div class="progress-bar">
<div class="progress-fill {{if gt .UsagePercent 90}}danger{{else if gt .UsagePercent 75}}warning{{end}}" style="width: {{.UsagePercent}}%"></div>
</div>
<small>{{.UsagePercent}}%</small>
</div>
</td>
<td class="date-cell">{{formatTime .AddedAt}}</td>
<td class="actions">
<a href="/admin/crew/{{.RKey}}" class="btn btn-icon" title="Edit" aria-label="Edit crew member {{if .Handle}}{{.Handle}}{{else}}{{.DID}}{{end}}">
<i data-lucide="pencil"></i>
</a>
<button class="btn btn-icon btn-danger" title="Delete" aria-label="Remove crew member {{if .Handle}}{{.Handle}}{{else}}{{.DID}}{{end}}" hx-post="/admin/crew/{{.RKey}}/delete" hx-confirm="Remove this crew member?" hx-target="#crew-{{.RKey}}" hx-swap="outerHTML">
<i data-lucide="trash-2"></i>
</button>
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<p class="empty">No crew members yet. <a href="/admin/crew/add">Add your first crew member</a>.</p>
{{end}}
</main>
<footer class="footer"><p>Hold: <code>{{.HoldDID}}</code></p></footer>
<script>lucide.createIcons();</script>
</body>
</html>
{{end}}