-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoolbar.html
More file actions
276 lines (275 loc) · 8.57 KB
/
toolbar.html
File metadata and controls
276 lines (275 loc) · 8.57 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!-- <pat-toolbar> -->
{% assign source = include.source %}
{% capture this_source_id %}{{ source.id | default: layout.application | slugify }}{% endcapture %}
{% if source.form %}
<form
class="pat-form">
{% endif %}
<div
class="
pat-toolbar
{{ source.type }}
{% if source.inject %}
pat-inject
pat-autosubmit
pat-subform
{% endif %}
{{ source.type }}"
{% if source.inject %}
data-pat-inject="{{ source.inject }}"
{% endif %}
id="{{ this_source_id }}">
<div
id="toolbar-navigation-area-{{ this_source_id }}"
class="
toolbar-area
navigation">
{% for section in source.sections %}
{% if section.type == 'navigation' %}
<div
class="
toolbar-section
navigation"
id="{{ include.id }}-{{ section.type }}">
<nav
class="
pat-navigation
pat-button-cluster
pat-tabs">
{% for link in section.links %}
{%- capture this_url -%}
{%- if link.url -%}
{{ link.url }}
{%- else -%}
{{ link.label | remove: 'label_' | slugify }}
{%- endif -%}
{%- endcapture -%}
<a
class="
pat-inject
{{ link.class }}
{% if link.icon %}
icon
icon-{{ link.icon }}
{% endif %}
{% if link.switch or section.switch %}
pat-switch
{% endif %}
{% if
page.url contains link.url
or
page.title == link.label %}
current
{% endif %}"
{% if link.switch %}
data-pat-switch="{{ link.switch }}"
{% elsif section.switch %}
data-pat-switch="{{ section.switch }}"
{% endif %}
{% if link.inject %}
data-pat-inject="{{ link.inject }}"
{% elsif section.inject %}
data-pat-inject="{{ section.inject }}"
{% else %}
data-pat-inject="
source: .application-body.state-on .document-body;
target: .application-body.state-on .document-body;
history: record
&&
source: #{{ this_source_id }} .toolbar-area.functions;
target: #{{ this_source_id }} .toolbar-area.functions;"
{% endif %}
href="{{ this_url }}">
{%- include patterns/i18n id=link.label -%}
</a>
{% endfor %}
</nav>
</div>
{% endif %}
{% endfor %}
</div>
<div
id="toolbar-functions-area-{{ this_source_id }}"
class="
toolbar-area
functions">
{% for section in source.sections %}
{% unless section.type == 'navigation' %}
{% capture this_section_id %}{{ include.id }}-{{ section.type }}{% endcapture %}
<div
class="
toolbar-section
{{ section.type }}"
id="{{ this_section_id }}">
{% if section.type == 'navigation stacks-control' %}
<nav
class="
toolbar-subnav
pat-button-cluster
pat-tabs
pat-navigation">
{% for link in section.links %}
{% assign this_label = link.label %}
<a
href="{{ link.url }}">{% include patterns/i18n id=this_label %}</a>
{% endfor %}
</nav>
{% elsif section.type == 'view-options' %}
{% for item in section.items %}
{% if item.for_pages == nil or item.for_pages contains page.title %}
{% if item.type == 'grouping' %}
<label
class="
pat-select">
{% include patterns/i18n id="patterns.label_grouping" %}
<select>
{% for option in item.options %}
<option>{{ option.label }}</option>
{% endfor %}
</select>
</label>
{% elsif item.type == 'back-button' %}
<a
href="{{ item.url }}"
class="
ueber-back-button
pat-inject"
data-pat-inject="
source: .application-body.state-on .document-body;
target: .application-body.state-on .document-body;
history: record">
{% include patterns/i18n id=item.label %}
</a>
{% elsif item.type == 'sidebar-toggle' %}
{% elsif item.type == 'select' %}
<label
class="
pat-select">
{% include patterns/i18n id=item.label %}
<select>
{% for option in item.items %}
<option>{% include patterns/i18n id=option.label %}</option>
{% endfor %}
</select>
</label>
{% elsif item.type == 'filters' %}
{%- capture this_filters_id -%}{{ source.id }}-filters{%- endcapture -%}
{% include patterns/toolbar-filters-menu.html
items=item.form_fields
id=this_filters_id %}
{% endif %}
{% endif %}
{% endfor %}
{% elsif section.type == 'quick-functions' %}
{% for item in section.items %}
{% if item.type == 'search' %}
{% include patterns/toolbar-search-field.html
placeholder=item.placeholder
inject=item.inject %}
{% elsif item.type == 'more-menu' %}
{% include patterns/more-menu.html
source=item.source %}
{% elsif item.type == 'context-menu' %}
{% include patterns/context-menu.html
icon=item.icon
class=item.class
source=item.source %}
{% elsif item.type == 'open-modal' %}
{% include patterns/open-modal.html
label=item.label
href=item.url
title=item.title
class=item.class %}
{% elsif item.type == 'inject' %}
<a
href="{{ item.url }}"
class="
pat-button
{{ item.class }}
pat-inject"
data-pat-inject="{{ item.inject }}">{{ item.label }}</a>
{% elsif item.type == 'forward' %}
<a
href="{{ item.forward }}"
data-pat-forward="selector: {{ item.forward }}"
class="
pat-button
pat-forward
{{ item.class }}
{% if item.switch %}pat-switch{% endif %}"
{% if item.switch %}data-pat-switch="{{ item.switch }}"{% endif %}>
{% include patterns/i18n id=item.label %}
</a>
{% elsif item.type == 'sidebar-size' %}
<button
type="button"
class="
icon
resize-full
toggle-sidebar-size
pat-toggle"
data-pat-toggle="
selector: #application-body-{{ layout.application | slugify }};
value: sidebar-normal sidebar-large"
title="{% include patterns/i18n sentinel=false id='patterns.label_toggle_sidebar_size' %}">
{%- include patterns/i18n id='patterns.label_toggle_sidebar_size_imp' -%}
</button>
{% elsif item.type == 'button' %}
{% if item.kind == 'submit' %}
<button
type="submit"
{% if item.url %}formaction="{{ item.url }}"{% endif %}
class="
pat-button
{{ item.class }}
{% if item.switch %}pat-switch{% endif %}"
{% if item.switch %}data-pat-switch="{{ item.switch }}"{% endif %}>
{% include patterns/i18n id=item.label %}
</button>
{% elsif item.kind == 'forward' %}
<a
type="button"
href="{{ item.forward }}"
data-pat-forward="selector: {{ item.forward }}"
class="
pat-button
pat-forward
{{ item.class }}
{% if item.switch %}pat-switch{% endif %}"
{% if item.switch %}data-pat-switch="{{ item.switch }}"{% endif %}>
{% include patterns/i18n id=item.label %}
</a>
{% elsif item.kind == 'link' %}
<a
href="{{ item.url }}"
class="
pat-button
{{ item.class }}
pat-inject"
data-pat-inject="{{ item.inject }}">{% include patterns/i18n id=item.label %}</a>
{% endif %}
{% elsif item.type == 'modal' %}
{% include patterns/open-modal.html
href=item.url
title=item.title
class=item.class %}
{% endif %}
{% endfor %}
{% endif %}
</div>
{% endunless %}
{% endfor %}
</div>
{% assign this_url = page.url %}
<button
class="
pat-assistive-element"
type="submit"
formaction="{{ source.action | default: this_url }}">
{%- include patterns/i18n id="patterns.label_submit_imp" -%}
</button>
</div>
{% if source.inject %}
</form>
{% endif %}
<!-- </pat-toolbar> -->