25 lines
796 B
Smarty
25 lines
796 B
Smarty
{{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}} {{if .options.required}}required{{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}}
|