Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
19 lines
608 B
HTML
19 lines
608 B
HTML
{{/*
|
|
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}}
|