mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-01 15:56:58 +00:00
37 lines
1.6 KiB
HTML
37 lines
1.6 KiB
HTML
{{ define "hold_selector" }}
|
|
<div class="card bg-base-200 shadow-sm p-4">
|
|
<form hx-post="/api/profile/default-hold" hx-swap="none" class="flex items-center gap-3 flex-wrap">
|
|
<label class="text-sm font-medium whitespace-nowrap" for="hold-select">Active Hold:</label>
|
|
<select id="hold-select" name="hold_did" class="select select-bordered select-sm flex-1 min-w-0"
|
|
data-action="submit-form">
|
|
{{ if not .ActiveHold }}
|
|
<option value="" selected>-- Select a hold --</option>
|
|
{{ end }}
|
|
|
|
<optgroup label="Your Holds">
|
|
{{ range .AllHolds }}
|
|
{{ if ne .Membership "eligible" }}
|
|
<option value="{{ .DID }}" {{ if .IsActive }}selected{{ end }}>
|
|
{{ .DisplayName }}{{ if eq .Membership "owner" }} (Owner){{ else }} (Crew){{ end }}{{ if .Region }} · {{ .Region }}{{ end }}
|
|
</option>
|
|
{{ end }}
|
|
{{ end }}
|
|
</optgroup>
|
|
|
|
{{ range .AllHolds }}{{ if eq .Membership "eligible" }}
|
|
<optgroup label="Available Holds">
|
|
{{ range $.AllHolds }}
|
|
{{ if eq .Membership "eligible" }}
|
|
<option value="{{ .DID }}">
|
|
{{ .DisplayName }}{{ if .Region }} · {{ .Region }}{{ end }} (Join)
|
|
</option>
|
|
{{ end }}
|
|
{{ end }}
|
|
</optgroup>
|
|
{{ break }}{{ end }}{{ end }}
|
|
</select>
|
|
<noscript><button type="submit" class="btn btn-sm btn-primary">Switch</button></noscript>
|
|
</form>
|
|
</div>
|
|
{{ end }}
|