-
Notifications
You must be signed in to change notification settings - Fork 0
/
form-panel.html
79 lines (77 loc) · 3 KB
/
form-panel.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{% if include.ui_content %}
{% assign ui_data_path = include.ui_content %}
{% else %}
{% assign ui_data_path = site.ui_data_path %}
{% endif %}
{% if include.src contains 'layout.' %}
{% capture src %}{{ include.src | remove: 'layout.' }}{% endcapture %}
{% elsif include.src contains 'page.' %}
{% capture src %}{{ include.src | remove: 'page.' }}{% endcapture %}
{% else %}
{% capture src %}{{ include.src }}{% endcapture %}
{% endif %}
<div
class="
form-panel
{% if include.collapsible %}pat-collapsible {{ include.collapsible }}{% endif %}
section
{{ include.class }}"
data-pat-collapsible="
store: local;
scroll-selector: self;
{%- if include.help_url -%}trigger: {{ page.title | slugify }}-{{ title_nr }}-form-panel-title{%- endif -%}
{% if include.scroll-offset %}scroll-offset: {{ include.scroll-offset }}{% endif %}"
id="{{ page.title | slugify }}-{{ title_nr }}">
{% assign title_nr = 1 %}
<div
class="form-panel-title-group">
<h3
id="{{ page.title | slugify }}-{{ title_nr }}-form-panel-title"
class="
{% if item.depends %}pat-depends{% endif %}
form-panel-title"
{% if item.depends %}data-pat-depends="{{ item.depends }}; transition: slide" {% endif %}>
{% include patterns/i18n id=include.title %}
</h3>
{%- if include.help_url -%}
<div
class="buttons">
<a
class="
pat-inject
icon
help
{%- if include.switch -%}pat-switch{%- endif -%}
{{ include.classes }}"
{%- if include.help_switch -%}
data-pat-switch="{{ include.help_switch }}"
{%- endif -%}
{%- if include.help_inject -%}
data-pat-inject="{{ include.help_inject }}"
{%- endif -%}
data-pat-inject="
history: record;
{%- if include.scroll -%}scroll: #{{ include.scroll }};{%- endif -%}"
href="{{ include.help_url }}">{%- include patterns/i18n id="label_help" -%}</a>
</div>
{%- endif -%}
</div>
<fieldset
class="
panel-content
{% if include.layout == 'horizontal' %}horizontal{% else %}vertical{% endif %}">
{% if include.src contains 'layout.' %}
{% for item in layout[src] %}
{% include patterns/form-component.html %}
{% endfor %}
{% elsif include.src contains 'page.' %}
{% for item in page[src] %}
{% include patterns/form-component.html %}
{% endfor %}
{% else %}
{% for item in site.data[src] %}
{% include patterns/form-component.html %}
{% endfor %}
{% endif %}
</fieldset>
</div>