2019-11-04 15:00:46 +01:00
|
|
|
{{define "select"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label" for="{{.options.id}}">{{.options.label}}</label>
|
|
|
|
<select name="{{.options.name}}"
|
|
|
|
class="form-control selectpicker"
|
|
|
|
id="{{.options.id}}"
|
|
|
|
placeholder="{{.options.placeholder}}"
|
|
|
|
data-live-search="true"
|
|
|
|
form="{{.form}}"
|
|
|
|
title="{{.options.title}}"
|
2019-12-09 08:27:46 +01:00
|
|
|
data-dropup-auto="false" {{if .options.multiple}}multiple{{end}} {{if .options.required}}required{{end}}>
|
2019-11-04 15:00:46 +01:00
|
|
|
<option value="0"></option>
|
|
|
|
{{range $el := .data}}
|
|
|
|
{{if $.update}}
|
|
|
|
<option
|
|
|
|
value="{{$el.ID}}"
|
|
|
|
{{index $.selected $el.ID}}>{{$el|string}}
|
|
|
|
</option>
|
|
|
|
{{else}}
|
|
|
|
<option value="{{$el.ID}}">{{$el|string}}</option>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
{{end}}
|