select.html.tpl 756 B

12345678910111213141516171819202122232425
  1. {{define "select"}}
  2. <div class="form-group">
  3. <label class="control-label" for="{{.options.id}}">{{.options.label}}</label>
  4. <select name="{{.options.name}}"
  5. class="form-control selectpicker"
  6. id="{{.options.id}}"
  7. placeholder="{{.options.placeholder}}"
  8. data-live-search="true"
  9. form="{{.form}}"
  10. title="{{.options.title}}"
  11. data-dropup-auto="false" {{if .options.multiple}}multiple{{end}}>
  12. <option value="0"></option>
  13. {{range $el := .data}}
  14. {{if $.update}}
  15. <option
  16. value="{{$el.ID}}"
  17. {{index $.selected $el.ID}}>{{$el|string}}
  18. </option>
  19. {{else}}
  20. <option value="{{$el.ID}}">{{$el|string}}</option>
  21. {{end}}
  22. {{end}}
  23. </select>
  24. </div>
  25. {{end}}