12345678910111213141516171819202122232425 |
- {{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}}"
- data-dropup-auto="false" {{if .options.multiple}}multiple{{end}}>
- <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}}
|