-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform-field-toggle.html
38 lines (38 loc) · 1.38 KB
/
form-field-toggle.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
<fieldset
{% include patterns/form-field-auto-save-attributes %}
class="
{{ include.class }}
pat-form-field-toggle
group
{% include patterns/form-field-auto-save-classes %}
{% if include.depends %}pat-depends{% endif %}"
{% if include.depends %}data-pat-depends="{{ include.depends }}; transition: slide"{% endif %}>
<legend>
{% include patterns/form-field-label-conditional.html %}
</legend>
<label
class="pat-toggle-switch">
{% if include.label_on %}
{%- capture this_label -%}{{ include.label_on }}{%- endcapture -%}
{% else %}
{%- capture this_label -%}{%- include patterns/i18n id="patterns.label_on" -%}{%- endcapture -%}
{% endif %}
{{ this_label }}
<input
tabindex="0"
{% if include.state == 'disabled' %}disabled{% endif %}
type="checkbox"
id="{{ include.id }}"
name="{{ include.name }}"
{% if include.checked == 'checked' %}
checked
{% endif %}
/>
</label>
{% include patterns/form-has-changes.html %}
{% if include.help %}
{% include patterns/form-help.html
content=include.help more=include.help_more %}
{% endif %}
{% include patterns/form-message.html message=include.message %}
</fieldset>