Initial Upload
This commit is contained in:
43
ui/src/templates/forms/inputs/dropdown.hbs
Normal file
43
ui/src/templates/forms/inputs/dropdown.hbs
Normal file
@@ -0,0 +1,43 @@
|
||||
<div class="form-group xibo-form-input dropdown-input-group
|
||||
{{#if selectType}}{{selectType}}{{else}}localSelect{{/if}}
|
||||
{{customClass}}
|
||||
{{variant}}"
|
||||
{{#if visibility}}data-visibility="{{visibility}}"{{/if}}
|
||||
{{#if dependsOn}}data-depends-on="{{dependsOn}}"{{/if}}
|
||||
{{#if isRequired}}data-is-required="{{isRequired}}"{{/if}}
|
||||
>
|
||||
<label for="{{#unless forceId}}input_{{/unless}}{{id}}" class="control-label"><strong>{{title}}</strong></label>
|
||||
<div class="input-info-container">
|
||||
{{#if helpText}}
|
||||
{{>add-ons/helpText helpText=helpText}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<select class="form-control" id="{{#unless forceId}}input_{{/unless}}{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}"
|
||||
{{#if multiple}}multiple{{/if}}
|
||||
{{#each customData}}
|
||||
data-{{this.name}}="{{this.value}}"
|
||||
{{/each}}
|
||||
{{#if readonly}}readonly{{/if}}
|
||||
>
|
||||
{{!-- Set default property values --}}
|
||||
{{#unless optionsValue}}
|
||||
{{set "optionsValue" "name"}}
|
||||
{{/unless}}
|
||||
{{#unless optionsTitle}}
|
||||
{{set "optionsTitle" "title"}}
|
||||
{{/unless}}
|
||||
|
||||
{{!-- Render options --}}
|
||||
{{#each options}}
|
||||
<option value="{{lookup this ../optionsValue}}"
|
||||
{{#eq (lookup this ../optionsValue) ../value}}selected{{/eq}}
|
||||
{{#if image}}
|
||||
data-content="{{> add-ons/dropdownOptionImage image=image title=(lookup this ../optionsTitle) }}"
|
||||
{{/if}}
|
||||
{{#if set}}
|
||||
data-set="{{#each set}}{{this}}{{#unless @last}},{{/unless}}{{/each}}"
|
||||
{{/if}}
|
||||
>{{lookup this ../optionsTitle}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
</div>
|
||||
Reference in New Issue
Block a user