-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform-field-checklist.html
More file actions
62 lines (62 loc) · 2.89 KB
/
form-field-checklist.html
File metadata and controls
62 lines (62 loc) · 2.89 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!-- <pat-form-field-checklist> -->
<fieldset
{% include patterns/form-field-auto-save-attributes %}
class="
group
{{ include.class }}
{% include patterns/form-field-auto-save-classes %}
{% if include.depends %}pat-depends{% endif %}"
{% if include.depends %}data-pat-depends="{{ include.depends }}; transition: slide"{% endif %}>
{% if include.label %}
<legend>
{%- include patterns/form-field-label-conditional.html -%}
</legend>
{% endif %}
{% if include.help %}
{% include patterns/form-help.html
content=include.help more=include.help_more %}
{% endif %}
<div
class="pat-checklist">
{% for sub in item.items %}
<label>
{%- if sub.label contains '_' -%}
{%- include patterns/i18n sentinel=false id=sub.label %}
{% else %}
{{ sub.label }}
{% endif %}
<input
{% if include.variation == 'radio' %}
{% if sub.value %}
value="{{ sub.value }}"
{% else %}
value="{{ sub.label | remove: 'label_' | slugify }}"
{% endif %}
{% endif %}
{% if sub.selected == 'selected' %}
checked
{% endif %}
{% if sub.disabled %}
disabled
{% endif %}
tabindex="0"
name="
{%- if include.variation == 'radio' -%}
{%- if include.name -%}
{{ include.name }}
{%- else -%}
{{ include.label | slugify | default: 'some_name_for_the_radios' }}
{%- endif -%}
{%- elsif sub.name -%}
{{ sub.name }}
{%- else -%}
{{ sub.label | remove: 'label_' | slugify }}
{%- endif -%}"
type="{{ include.variation | default: 'checkbox' }}">
</label>
{% endfor %}
</div>
{% include patterns/form-message.html message=include.message %}
{% include patterns/form-has-changes.html %}
</fieldset>
<!-- </pat-form-field-checklist> -->