Changeset 0.22.5 (#147)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit is contained in:
18
server/pages/templates/components/team-select.html
Normal file
18
server/pages/templates/components/team-select.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{/*
|
||||
team-select: Reusable team dropdown.
|
||||
Pre-populated from server data — no client-side fetch needed.
|
||||
*/}}
|
||||
{{define "team-select"}}
|
||||
<div class="form-group">
|
||||
{{if index . "Label"}}<label>{{index . "Label"}}</label>{{end}}
|
||||
<select name="{{index . "FieldName"}}" class="team-select">
|
||||
{{if index . "AllowEmpty"}}
|
||||
<option value="">— all teams —</option>
|
||||
{{end}}
|
||||
{{$sel := index . "Selected"}}
|
||||
{{range index . "Teams"}}
|
||||
<option value="{{.ID}}"{{if eq .ID $sel}} selected{{end}}>{{.Name}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user