-
Notifications
You must be signed in to change notification settings - Fork 0
/
form-field-button-bar.html
45 lines (45 loc) · 1.24 KB
/
form-field-button-bar.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
<div
class="
{% if include.depends %}pat-depends{% endif %}
group
pat-form-field-button-bar
{{ include.class }}"
{% if include.depends %}data-pat-depends="{{ include.depends }}"{% endif %}>
<div
class="pat-button-bar">
<!-- <slot id="buttons"> -->
{% for sub in include.items %}
<!-- <pat-button> -->
{% if sub.type == 'link' %}
<a
class="
pat-button
pat-inject"
href="{{ sub.url }}">{%- include patterns/i18n id=sub.label -%}</a>
{% elsif sub.type == 'modal' %}
<a
class="
pat-button
pat-modal"
data-pat-modal="class: {{ sub.class }}"
href="{{ sub.url }}">{%- include patterns/i18n id=sub.label -%}</a>
{% else %}
<button
{% if sub.url %}
formaction="{{ sub.url }}"
{% endif %}
{% if sub.inject %}
data-pat-inject="{{ sub.inject }}"
{% endif %}
type="{{ sub.type }}"
{% if sub.state == 'disabled' %}disabled{% endif %}
class="
{% if sub.inject %}pat-inject{% endif %}
pat-button
{{ sub.class }}">{%- include patterns/i18n id=sub.label -%}</button>
{% endif %}
<!-- </pat-button> -->
{% endfor %}
<!-- </slot> -->
</div>
</div>