-
Notifications
You must be signed in to change notification settings - Fork 0
/
form-field-select.html
48 lines (48 loc) · 1.59 KB
/
form-field-select.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!-- <pat-form-field-select> -->
<label
{% include patterns/form-field-auto-save-attributes %}
class="
pat-select
{% include patterns/form-field-auto-save-classes %}
{% if item.depends %}pat-depends{% endif %}
{% if item.subform %}pat-subform{% endif %}
{% if item.auto-submit %}pat-autosubmit{% endif %}
{% if item.inject %}pat-inject{% endif %}"
{% if item.id %}id="{{ item.id }}"{% endif %}
{% if item.inject %}data-pat-inject="{{ item.inject }}"{% endif %}
{% if item.depends %}data-pat-depends="{{ item.depends }};"{% endif %}>
{% include patterns/form-field-label-conditional.html %}
<select
name="{{ item.name }}">
{% for subitem in item.items %}
<option
{% if subitem.value %}
value="{{ subitem.value }}"
{% else %}
value="{{ subitem.label | remove: 'label_' | slugify }}"
{% endif %}
{% if subitem.selected %}selected{% endif %}
class="{% if subitem.depends %}pat-depends{% endif %}"
{% if subitem.depends %}data-pat-depends="{{ subitem.depends }}"{% endif %}>
{% if subitem.label contains 'label_' %}
{% include patterns/i18n
id=subitem.label %}
{% else %}
{{ subitem.label }}
{% endif %}
</option>
{% endfor %}
</select>
{% if item.message %}
<p
class="pat-message {{ item.message-type }}">
{% include patterns/i18n id=item.message %}
</p>
{% endif %}
{% if item.help %}
{% include patterns/form-help.html
content=item.help more=item.help_more %}
{% endif %}
{% include patterns/form-has-changes.html %}
</label>
<!-- </pat-form-field-select> -->