@openeuropa/bcl-theme-default 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/oe-bcl-default.css +344 -0
- package/css/oe-bcl-default.css.map +1 -1
- package/css/oe-bcl-default.min.css +1 -1
- package/css/oe-bcl-default.min.css.map +1 -1
- package/icons/bcl-default-icons.svg +1 -1
- package/js/oe-bcl-default.bundle.js +242 -76
- package/js/oe-bcl-default.bundle.js.map +1 -1
- package/js/oe-bcl-default.bundle.min.js +1 -1
- package/js/oe-bcl-default.bundle.min.js.map +1 -1
- package/js/oe-bcl-default.esm.js +236 -75
- package/js/oe-bcl-default.esm.js.map +1 -1
- package/js/oe-bcl-default.esm.min.js +1 -1
- package/js/oe-bcl-default.esm.min.js.map +1 -1
- package/js/oe-bcl-default.umd.js +242 -76
- package/js/oe-bcl-default.umd.js.map +1 -1
- package/js/oe-bcl-default.umd.min.js +1 -1
- package/js/oe-bcl-default.umd.min.js.map +1 -1
- package/package.json +5 -5
- package/src/icons/icons.js +19 -0
- package/src/js/gallery/gallery.js +168 -0
- package/src/js/index.esm.js +2 -0
- package/src/js/index.umd.js +2 -0
- package/src/scss/_bcl-offcanvas.scss +7 -0
- package/src/scss/_carousel.scss +85 -0
- package/src/scss/_circular-progress-bar.scss +13 -11
- package/src/scss/_gallery.scss +262 -0
- package/src/scss/_pagination.scss +8 -0
- package/src/scss/_search-form.scss +4 -2
- package/src/scss/base/_utilities.scss +1 -0
- package/src/scss/oe-bcl-default.scss +3 -0
- package/templates/bcl-base-templates/listing-page.html.twig +13 -13
- package/templates/bcl-card/card.html.twig +35 -22
- package/templates/bcl-carousel/carousel.html.twig +26 -5
- package/templates/bcl-content-banner/content-banner.html.twig +30 -42
- package/templates/bcl-date-block/date-block.html.twig +29 -9
- package/templates/bcl-footer/footer.html.twig +3 -1
- package/templates/bcl-gallery/gallery.html.twig +203 -0
- package/templates/bcl-listing/listing.html.twig +1 -1
- package/templates/bcl-pagination/pagination.html.twig +123 -9
- package/templates/bcl-person/person.html.twig +44 -0
- package/templates/bcl-select/select.html.twig +10 -3
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
|
|
1
3
|
// Search form Spacers
|
|
2
4
|
$search-spacers: (
|
|
3
5
|
"icon-spacer-left": map-get($spacers, 3),
|
|
4
|
-
"icon-spacer-top":
|
|
6
|
+
"icon-spacer-top": math.div(($form-select-height - map-get($icon, "xs")), 2),
|
|
5
7
|
"icon-spacer-top-md":
|
|
6
|
-
|
|
8
|
+
math.div(($form-select-height-md - map-get($icon, "xs")), 2),
|
|
7
9
|
"submit-spacer-right": map-get($spacers, 3),
|
|
8
10
|
);
|
|
9
11
|
|
|
@@ -71,3 +71,6 @@
|
|
|
71
71
|
@import "@openeuropa/bcl-theme-default/src/scss/timeline";
|
|
72
72
|
@import "@openeuropa/bcl-theme-default/src/scss/inpage-navigation";
|
|
73
73
|
@import "@openeuropa/bcl-theme-default/src/scss/language-list";
|
|
74
|
+
@import "@openeuropa/bcl-theme-default/src/scss/carousel";
|
|
75
|
+
@import "@openeuropa/bcl-theme-default/src/scss/gallery";
|
|
76
|
+
@import "@openeuropa/bcl-theme-default/src/scss/pagination";
|
|
@@ -17,32 +17,32 @@
|
|
|
17
17
|
{% block content_top %}
|
|
18
18
|
{% include '@oe-bcl/bcl-button/button.html.twig' with filter_button only %}
|
|
19
19
|
<div class="row">
|
|
20
|
-
<div class="col-md-6 col-lg-8">
|
|
21
|
-
<h4>
|
|
20
|
+
<div class="col-md-6 col-lg-8 align-self-center">
|
|
21
|
+
<h4 class="mb-0">
|
|
22
22
|
<span class="text-capitalize">
|
|
23
23
|
{{- _page_title -}}
|
|
24
24
|
</span>
|
|
25
25
|
({{ listing.items.length }})
|
|
26
26
|
</h4>
|
|
27
27
|
</div>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
{% if badges is not empty and badges is iterable %}
|
|
29
|
+
<div class="col-md-12 order-md-2 mt-3">
|
|
30
|
+
{% for badge in badges %}
|
|
31
|
+
{% include '@oe-bcl/bcl-badge/badge.html.twig' with badge|merge({
|
|
32
|
+
attributes: create_attribute().addClass(["mb-2", "me-2"])
|
|
33
|
+
}) only %}
|
|
34
|
+
{% endfor %}
|
|
35
|
+
</div>
|
|
36
|
+
{% endif %}
|
|
37
37
|
<div class="col-md-6 col-lg-4 mt-3 mt-md-0">
|
|
38
38
|
<div class="float-md-end d-md-flex align-items-center mb-4 mb-md-0">
|
|
39
39
|
{% include '@oe-bcl/bcl-select/select.html.twig' with sort_select|merge({
|
|
40
|
-
attributes: create_attribute().addClass(['ms-md-2
|
|
40
|
+
attributes: create_attribute().addClass(['ms-md-2']),
|
|
41
41
|
}) only %}
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
44
|
</div>
|
|
45
|
-
<hr class="d-none d-md-block mb-4"/>
|
|
45
|
+
<hr class="d-none d-md-block mb-4-75"/>
|
|
46
46
|
{% endblock %}
|
|
47
47
|
|
|
48
48
|
{% block content %}
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
|
|
48
48
|
Blocks
|
|
49
49
|
- card_date
|
|
50
|
-
-
|
|
50
|
+
- card_badges
|
|
51
|
+
- card_links
|
|
51
52
|
#}
|
|
52
53
|
|
|
53
54
|
{% set _title = title|default({}) %}
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
{% set _extra_classes_header = extra_classes_header|default('') %}
|
|
71
72
|
{% set _extra_classes_footer = extra_classes_footer|default('') %}
|
|
72
73
|
{% set _badges = badges|default([]) %}
|
|
74
|
+
{% set _links = links|default([]) %}
|
|
73
75
|
{% set _classes = ['card'] %}
|
|
74
76
|
{% if _text_color is not empty %}
|
|
75
77
|
{% set _classes = _classes|merge(['text-' ~ _text_color]) %}
|
|
@@ -198,31 +200,42 @@
|
|
|
198
200
|
{%- if _content is not empty -%}
|
|
199
201
|
{{- _content -}}
|
|
200
202
|
{%- endif -%}
|
|
201
|
-
{
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
{%
|
|
203
|
+
{% block card_badges %}
|
|
204
|
+
{%- if _badges is not empty and _badges is iterable -%}
|
|
205
|
+
<div class="mt-2-5">
|
|
206
|
+
{% for _badge in _badges %}
|
|
207
|
+
{% if _badge.attributes is empty %}
|
|
208
|
+
{% set _badge = _badge|merge({
|
|
209
|
+
attributes: create_attribute()
|
|
210
|
+
}) %}
|
|
211
|
+
{% endif %}
|
|
205
212
|
{% set _badge = _badge|merge({
|
|
206
|
-
|
|
207
|
-
}) %}
|
|
208
|
-
{% endif %}
|
|
209
|
-
{% set _badge = _badge|merge({
|
|
210
|
-
attributes: _badge.attributes.addClass('mb-2')
|
|
211
|
-
})
|
|
212
|
-
%}
|
|
213
|
-
{% if not loop.last %}
|
|
214
|
-
{% set _badge = _badge|merge({
|
|
215
|
-
attributes: _badge.attributes.addClass('me-2')
|
|
213
|
+
attributes: _badge.attributes.addClass('mb-2')
|
|
216
214
|
})
|
|
217
215
|
%}
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
{% if not loop.last %}
|
|
217
|
+
{% set _badge = _badge|merge({
|
|
218
|
+
attributes: _badge.attributes.addClass('me-2')
|
|
219
|
+
})
|
|
220
|
+
%}
|
|
221
|
+
{% endif %}
|
|
220
222
|
{% include '@oe-bcl/bcl-badge/badge.html.twig' with _badge only %}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
{
|
|
223
|
+
|
|
224
|
+
{% endfor %}
|
|
225
|
+
</div>
|
|
226
|
+
{%- endif -%}
|
|
227
|
+
{% endblock %}
|
|
228
|
+
{% block card_links %}
|
|
229
|
+
{%- if _links is not empty and _links is iterable -%}
|
|
230
|
+
<div class="mt-2-5 mb-2">
|
|
231
|
+
{% for _link in _links %}
|
|
232
|
+
<div class="mb-3 mb-md-0 d-block d-md-inline-block me-4-5">
|
|
233
|
+
{% include '@oe-bcl/bcl-link/link.html.twig' with _link only %}
|
|
234
|
+
</div>
|
|
235
|
+
{% endfor %}
|
|
236
|
+
</div>
|
|
237
|
+
{%- endif -%}
|
|
238
|
+
{% endblock %}
|
|
226
239
|
</div>
|
|
227
240
|
{% if _horizontal %}
|
|
228
241
|
</div>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
image: (string) <img> tag
|
|
12
12
|
caption (string)
|
|
13
13
|
caption_classes (string)
|
|
14
|
+
caption_title (string)
|
|
14
15
|
interval (integer) (default: 0)
|
|
15
16
|
}
|
|
16
17
|
...
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
- previous_label (string) (default: '')
|
|
21
22
|
- next_label (string) (default: '')
|
|
22
23
|
- with_indicators (boolean) (default: false)
|
|
24
|
+
- rounded_indicators (boolean) (default: false)
|
|
23
25
|
#}
|
|
24
26
|
|
|
25
27
|
{% set _id = id|default('') %}
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
{% set _prev_label = prev_label|default('') %}
|
|
30
32
|
{% set _next_label = next_label|default('') %}
|
|
31
33
|
{% set _with_indicators = with_indicators|default(false) %}
|
|
34
|
+
{% set _rounded_indicators = rounded_indicators|default(false) %}
|
|
32
35
|
{% set _classes = ['carousel slide'] %}
|
|
33
36
|
{% set _autoinit = autoinit ?? true %}
|
|
34
37
|
{% set _autoplay = autoplay ?? true %}
|
|
@@ -59,6 +62,10 @@
|
|
|
59
62
|
{% set attributes = attributes.setAttribute('data-bs-touch', 'false') %}
|
|
60
63
|
{% endif %}
|
|
61
64
|
|
|
65
|
+
{% if _rounded_indicators %}
|
|
66
|
+
{% set attributes = attributes.addClass('rounded-indicators') %}
|
|
67
|
+
{% endif %}
|
|
68
|
+
|
|
62
69
|
{% if not _autoplay %}
|
|
63
70
|
{% set attributes = attributes.setAttribute('data-bs-interval', 'false') %}
|
|
64
71
|
{% endif %}
|
|
@@ -69,7 +76,7 @@
|
|
|
69
76
|
{{ attributes }}
|
|
70
77
|
>
|
|
71
78
|
{% if _with_indicators %}
|
|
72
|
-
<div class="carousel-indicators">
|
|
79
|
+
<div class="carousel-indicators d-none d-md-flex">
|
|
73
80
|
{% for _i in 0..(_items|length - 1) %}
|
|
74
81
|
{% set button_attributes = create_attribute()
|
|
75
82
|
.setAttribute('aria-label', 'Slide ' ~ (_i + 1))
|
|
@@ -102,15 +109,29 @@
|
|
|
102
109
|
{% if _item.image is defined and _item.image is not empty %}
|
|
103
110
|
{{ _item.image }}
|
|
104
111
|
{% endif %}
|
|
105
|
-
{% if _item.caption is defined and _item.caption is not empty %}
|
|
112
|
+
{% if (_item.caption is defined and _item.caption is not empty) or (_item.link is defined and _item.link is not empty) %}
|
|
106
113
|
{% set _caption_classes = 'carousel-caption' %}
|
|
107
|
-
{% if _item.
|
|
108
|
-
{% set _caption_classes = _caption_classes ~ ' '
|
|
114
|
+
{% if _item.caption is not empty and _item.link is empty %}
|
|
115
|
+
{% set _caption_classes = _caption_classes ~ ' d-none d-md-block' %}
|
|
109
116
|
{% endif %}
|
|
110
117
|
<div
|
|
111
118
|
class="{{ _caption_classes }}"
|
|
112
119
|
>
|
|
113
|
-
{
|
|
120
|
+
{% if _item.caption is not empty or _item.caption_title is not empty %}
|
|
121
|
+
{% if _item.caption_classes is defined and _item.caption_classes is not empty %}
|
|
122
|
+
<div class="{{ _item.caption_classes }}">
|
|
123
|
+
{% endif %}
|
|
124
|
+
{% if _item.caption_title is not empty %}
|
|
125
|
+
<h5>{{ _item.caption_title }}</h5>
|
|
126
|
+
{% endif %}
|
|
127
|
+
{{- _item.caption -}}
|
|
128
|
+
{% if _item.caption_classes is defined and _item.caption_classes is not empty %}
|
|
129
|
+
</div>
|
|
130
|
+
{% endif %}
|
|
131
|
+
{% endif %}
|
|
132
|
+
{% if _item.link is defined and _item.link is not empty %}
|
|
133
|
+
{% include '@oe-bcl/bcl-link/link.html.twig' with _item.link only %}
|
|
134
|
+
{% endif %}
|
|
114
135
|
</div>
|
|
115
136
|
{% endif %}
|
|
116
137
|
</div>
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
Parameters:
|
|
5
5
|
- "background" (string) (default: 'white')
|
|
6
6
|
options: [ white, gray ]
|
|
7
|
-
- "banner" (object)
|
|
8
7
|
- "title" (object)
|
|
9
8
|
- "image" (object)
|
|
9
|
+
- "image_size" (string)
|
|
10
|
+
options: ['sm', 'md', 'lg']
|
|
10
11
|
- "content" (string)
|
|
11
12
|
- "badges" (array of objects of type badge)
|
|
13
|
+
- "links" (array of objects of type link)
|
|
12
14
|
- "action_button" (object of type button) (default: {})
|
|
13
15
|
- "service_buttons" (array of objects of type button) (default: [])
|
|
14
16
|
- "attributes" (drupal attrs)
|
|
@@ -18,6 +20,7 @@
|
|
|
18
20
|
{% set _action_button = action_button|default({}) %}
|
|
19
21
|
{% set _service_buttons = service_buttons|default([]) %}
|
|
20
22
|
{% set _image = image|default({}) %}
|
|
23
|
+
{% set _image_size = image_size|default('md') %}
|
|
21
24
|
|
|
22
25
|
{% set _css_classes = [
|
|
23
26
|
'bcl-content-banner',
|
|
@@ -46,34 +49,27 @@
|
|
|
46
49
|
{% endif %}
|
|
47
50
|
|
|
48
51
|
{% set _body_classes = 'pt-0 px-0 pb-0' %}
|
|
49
|
-
{% set
|
|
52
|
+
{% set _left_col_classes = '' %}
|
|
53
|
+
{% set _right_col_classes = 'col-md-8 col-lg-9 col-xxl-8' %}
|
|
50
54
|
|
|
51
55
|
{% if _image is not empty %}
|
|
52
|
-
{% set
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{% if _action_button is not empty %}
|
|
59
|
-
{% set _horizontal_classes = {
|
|
60
|
-
left_col_classes: 'col-md-4 col-lg-3',
|
|
61
|
-
right_col_classes: 'col-md-8 col-lg-9 col-xxl-9'
|
|
62
|
-
} %}
|
|
56
|
+
{% set _left_col_classes = 'col-8 col-md-4 col-lg-3 offset-2 offset-md-0' %}
|
|
57
|
+
{% set _right_col_classes = 'col-md-8 col-lg-9 col-xxl-8' %}
|
|
58
|
+
{% set _body_classes = 'pt-4 pt-md-0 px-0 px-md-3 pb-0' %}
|
|
59
|
+
{% if _image_size == 'lg' %}
|
|
60
|
+
{% set _left_col_classes = 'col-md-4' %}
|
|
61
|
+
{% set _right_col_classes = 'col-md-8' %}
|
|
63
62
|
{% endif %}
|
|
64
|
-
{%
|
|
65
|
-
|
|
66
|
-
right_col_classes: 'col-md-8 col-lg-9 col-xxl-8',
|
|
67
|
-
} %}
|
|
68
|
-
|
|
69
|
-
{% if _action_button is not empty %}
|
|
70
|
-
{% set _horizontal_classes = {
|
|
71
|
-
right_col_classes: 'col-12'
|
|
72
|
-
} %}
|
|
73
|
-
{% set _card_grid = 'col-12 col-md-8' %}
|
|
63
|
+
{% if _image_size == 'sm' %}
|
|
64
|
+
{% set _left_col_classes = 'col-6 col-md-4 col-lg-2 offset-3 offset-md-0' %}
|
|
74
65
|
{% endif %}
|
|
75
66
|
{% endif %}
|
|
76
67
|
|
|
68
|
+
{% set _horizontal_classes = {
|
|
69
|
+
left_col_classes: _left_col_classes,
|
|
70
|
+
right_col_classes: _right_col_classes,
|
|
71
|
+
} %}
|
|
72
|
+
|
|
77
73
|
{% set _card = {
|
|
78
74
|
title: title|default({})|merge({
|
|
79
75
|
tag: 'h2',
|
|
@@ -94,30 +90,22 @@
|
|
|
94
90
|
|
|
95
91
|
<div class="{{ _css_classes|join(' ') }}">
|
|
96
92
|
<div class="container">
|
|
97
|
-
|
|
98
|
-
{% if _action_button is not empty %}
|
|
99
|
-
<div class="{{ _card_grid }}">
|
|
100
|
-
{% endif %}
|
|
101
|
-
{% include '@oe-bcl/bcl-card/card.html.twig' with _card %}
|
|
102
|
-
{% if _action_button is not empty %}
|
|
103
|
-
</div>
|
|
104
|
-
{% endif %}
|
|
93
|
+
{% include '@oe-bcl/bcl-card/card.html.twig' with _card %}
|
|
105
94
|
|
|
106
|
-
{% if _action_button is not empty %}
|
|
107
|
-
<div class="
|
|
108
|
-
|
|
95
|
+
{% if _service_buttons is not empty or _action_button is not empty %}
|
|
96
|
+
<div class="d-flex justify-content-end mt-2 align-items-center">
|
|
97
|
+
{% if _service_buttons is not empty %}
|
|
98
|
+
{% for _button in _service_buttons %}
|
|
99
|
+
{% include '@oe-bcl/bcl-button/button.html.twig' with _button only %}
|
|
100
|
+
{% endfor %}
|
|
101
|
+
{% endif %}
|
|
102
|
+
{% if _action_button is not empty %}
|
|
103
|
+
<div class="d-grid d-md-block ms-3">
|
|
109
104
|
{% include '@oe-bcl/bcl-button/button.html.twig' with _action_button only %}
|
|
110
105
|
</div>
|
|
106
|
+
{% endif %}
|
|
111
107
|
</div>
|
|
112
108
|
{% endif %}
|
|
113
|
-
{% if _service_buttons is not empty %}
|
|
114
|
-
<div class="d-flex justify-content-end">
|
|
115
|
-
{% for _button in _service_buttons %}
|
|
116
|
-
{% include '@oe-bcl/bcl-button/button.html.twig' with _button only %}
|
|
117
|
-
{% endfor %}
|
|
118
|
-
</div>
|
|
119
|
-
{% endif %}
|
|
120
|
-
</div>
|
|
121
109
|
</div>
|
|
122
110
|
</div>
|
|
123
111
|
|
|
@@ -7,24 +7,29 @@
|
|
|
7
7
|
- "month" (string) (default: '')
|
|
8
8
|
- "date_time" (string) (default: '')
|
|
9
9
|
- "year" (integer) (default: '')
|
|
10
|
+
- "end_day" (integer) (default: '')
|
|
11
|
+
- "end_month" (string) (default: '')
|
|
12
|
+
- "end_year" (integer) (default: '')
|
|
10
13
|
#}
|
|
11
14
|
|
|
12
15
|
{% set _month = month|default('') %}
|
|
13
16
|
{% set _day = day|default('') %}
|
|
14
17
|
{% set _year = year|default('') %}
|
|
15
18
|
{% set _date_time = date_time|default('') %}
|
|
19
|
+
{% set _end_day = end_day|default('') %}
|
|
20
|
+
{% set _end_month = end_month|default('') %}
|
|
21
|
+
{% set _end_year = end_year|default('') %}
|
|
16
22
|
{% set _variant = variant|default('') %}
|
|
17
23
|
{% set _css_classes = [
|
|
18
24
|
'bcl-date-block',
|
|
19
|
-
'd-flex',
|
|
20
|
-
'flex-column',
|
|
21
|
-
'align-items-center',
|
|
22
|
-
'justify-content-center',
|
|
23
25
|
'bg-date',
|
|
24
|
-
'
|
|
25
|
-
'pt-2',
|
|
26
|
-
'rounded-top',
|
|
26
|
+
'rounded',
|
|
27
27
|
'mw-date',
|
|
28
|
+
'text-center',
|
|
29
|
+
'd-flex',
|
|
30
|
+
'flex-column',
|
|
31
|
+
'ratio',
|
|
32
|
+
'ratio-1x1'
|
|
28
33
|
] %}
|
|
29
34
|
|
|
30
35
|
{% if attributes is empty %}
|
|
@@ -38,8 +43,23 @@
|
|
|
38
43
|
{% endif %}
|
|
39
44
|
|
|
40
45
|
<time {{ attributes }}>
|
|
41
|
-
<span class="
|
|
42
|
-
|
|
46
|
+
<span class="d-flex flex-column pt-2">
|
|
47
|
+
<span class="d-flex flex-column align-item-center justify-content-center bg-white border border-bottom-0 w-100 h-100 fs-5 text-uppercase">
|
|
48
|
+
<span class="d-block">{{- _day ~ ' ' ~ _month ~ ((_end_day or _end_month) ? ' - ' ) -}}</span>
|
|
49
|
+
{%- if _end_day is not empty -%}
|
|
50
|
+
{{- _end_day -}}
|
|
51
|
+
{% endif %}
|
|
52
|
+
{% if _end_month is not empty %}
|
|
53
|
+
{{- _end_month -}}
|
|
54
|
+
{%- endif -%}
|
|
55
|
+
</span>
|
|
56
|
+
<span class="bg-lighter border w-100 rounded-bottom py-1">
|
|
57
|
+
{{- _year -}}
|
|
58
|
+
{%- if _end_year is not empty -%}
|
|
59
|
+
{{ ' - ' ~ _end_year }}
|
|
60
|
+
{%- endif -%}
|
|
61
|
+
</span>
|
|
62
|
+
</span>
|
|
43
63
|
</time>
|
|
44
64
|
|
|
45
65
|
{% endspaceless %}
|
|
@@ -69,9 +69,11 @@
|
|
|
69
69
|
{% endif %}
|
|
70
70
|
{% if item.type == 'links' %}
|
|
71
71
|
{% for link in item.links %}
|
|
72
|
+
<div class="mb-1">
|
|
72
73
|
{% include '@oe-bcl/bcl-link/link.html.twig' with link|merge({
|
|
73
|
-
attributes: create_attribute().addClass(['
|
|
74
|
+
attributes: create_attribute().addClass(['standalone'])
|
|
74
75
|
}) only %}
|
|
76
|
+
</div>
|
|
75
77
|
{% endfor %}
|
|
76
78
|
{% endif %}
|
|
77
79
|
{% endfor %}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
{% spaceless %}
|
|
2
|
+
|
|
3
|
+
{#
|
|
4
|
+
Parameters:
|
|
5
|
+
- "id" (string) (default: '')
|
|
6
|
+
- "title" (string) (default: '')
|
|
7
|
+
- "title_tag" (string) (default: 'h2')
|
|
8
|
+
- "counter" (string) (default: '')
|
|
9
|
+
- "toggle_collapsed" (string) (default: '')
|
|
10
|
+
- "toggle_expanded" (string) (default: '')
|
|
11
|
+
- "previous_label" (string) (default: '')
|
|
12
|
+
- "next_label" (string) (default: '')
|
|
13
|
+
- "max_visible_thumbnails" (int) (default: 5)
|
|
14
|
+
- "items" (array of objects) format: [
|
|
15
|
+
{
|
|
16
|
+
thumbnails (string) img path
|
|
17
|
+
media: (string) <img> tag
|
|
18
|
+
caption (string)
|
|
19
|
+
caption_title (string)
|
|
20
|
+
caption_classes (string)
|
|
21
|
+
interval (integer) (default: 0)
|
|
22
|
+
}
|
|
23
|
+
...
|
|
24
|
+
],
|
|
25
|
+
- "icon_path" (string) (default: '')
|
|
26
|
+
#}
|
|
27
|
+
|
|
28
|
+
{# Internal properties #}
|
|
29
|
+
|
|
30
|
+
{% set _id = id|default('gallery-' ~ random(1000)) %}
|
|
31
|
+
{% set _title = title|default('') %}
|
|
32
|
+
{% set _title_tag = title_tag|default('h2') %}
|
|
33
|
+
{% set _counter = counter|default('') %}
|
|
34
|
+
{% set _toggle_collapsed = toggle_collapsed|default('') %}
|
|
35
|
+
{% set _toggle_expanded = toggle_expanded|default('') %}
|
|
36
|
+
{% set _next_label = next_label|default('Next') %}
|
|
37
|
+
{% set _prev_label = prev_label|default('Previous') %}
|
|
38
|
+
{% set _items = items|default([]) %}
|
|
39
|
+
{% set _max_visible_thumbnails = max_visible_thumbnails|default(5) %}
|
|
40
|
+
{% set _icon_path = icon_path|default('') %}
|
|
41
|
+
|
|
42
|
+
{% set _carousel_items = [] %}
|
|
43
|
+
{% set _carousel_id = "carousel" ~ _id|capitalize %}
|
|
44
|
+
{% set _modal_id = "modal" ~ _id|capitalize %}
|
|
45
|
+
{% set _collpase_id = "collapse" ~ _id|capitalize %}
|
|
46
|
+
{% set _max_visible_thumbnails = _max_visible_thumbnails + 1 %}
|
|
47
|
+
|
|
48
|
+
{% if attributes is empty %}
|
|
49
|
+
{% set attributes = create_attribute() %}
|
|
50
|
+
{% endif %}
|
|
51
|
+
|
|
52
|
+
{% set attributes = attributes.addClass('bcl-gallery') %}
|
|
53
|
+
|
|
54
|
+
{# Print the result #}
|
|
55
|
+
|
|
56
|
+
{% if _items is not empty %}
|
|
57
|
+
|
|
58
|
+
<div {{ attributes }}>
|
|
59
|
+
{% if _items is iterable %}
|
|
60
|
+
<div class="d-sm-flex flex-sm-row align-items-sm-center">
|
|
61
|
+
<div class="flex-sm-grow-1">
|
|
62
|
+
{%- if _title is not empty -%}
|
|
63
|
+
{% set _title_classes = 'fw-bold mb-3' %}
|
|
64
|
+
<{{ _title_tag }} class="{{ _title_classes }}">
|
|
65
|
+
{{- _title -}}
|
|
66
|
+
</{{ _title_tag }}>
|
|
67
|
+
{%- endif -%}
|
|
68
|
+
</div>
|
|
69
|
+
<div class="mb-3 mb-sm-0 fw-bold">
|
|
70
|
+
{%- if _counter is not empty -%}
|
|
71
|
+
{{ _counter|replace({'%d': _items|length}) }}
|
|
72
|
+
{%- endif -%}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
{% for _item in _items %}
|
|
77
|
+
{% if loop.first %}
|
|
78
|
+
<div class="bcl-gallery__thumbnails">
|
|
79
|
+
{% endif %}
|
|
80
|
+
{% if loop.index == _max_visible_thumbnails %}
|
|
81
|
+
<div class="bcl-gallery__thumbnails-collaspe collapse" id="{{ _collpase_id }}">
|
|
82
|
+
{% endif %}
|
|
83
|
+
{% if loop.index % _max_visible_thumbnails == 0 or loop.first %}
|
|
84
|
+
<ul class="bcl-gallery__grid">
|
|
85
|
+
{% endif %}
|
|
86
|
+
<li>
|
|
87
|
+
<a href="#" data-bs-target="#{{ _carousel_id }}" data-bs-slide-to="{{ loop.index - 1 }}" class="bcl-gallery__item d-block w-100 img-fluid">
|
|
88
|
+
<div class="bcl-gallery__item-overlay" data-bs-target="#{{ _modal_id }}" data-bs-toggle="modal">
|
|
89
|
+
{% if '<iframe' in _item.media or '<video' in _item.media %}
|
|
90
|
+
<span class="bcl-gallery__item-play-icon">
|
|
91
|
+
{% include '@oe-bcl/bcl-icon/icon.html.twig' with {
|
|
92
|
+
name: 'play-fill',
|
|
93
|
+
size: 's',
|
|
94
|
+
path: _icon_path,
|
|
95
|
+
} only %}
|
|
96
|
+
</span>
|
|
97
|
+
{% endif %}
|
|
98
|
+
{% if _item.caption is not empty or item.caption_title is not empty %}
|
|
99
|
+
<div class="bcl-gallery__item-caption">
|
|
100
|
+
{% if _item.caption_title is not empty %}
|
|
101
|
+
<h5>{{ _item.caption_title }}</h5>
|
|
102
|
+
{% endif %}
|
|
103
|
+
{% if _item.caption is not empty %}
|
|
104
|
+
<div class="bcl-gallery__item-description">
|
|
105
|
+
{{ _item.caption }}
|
|
106
|
+
</div>
|
|
107
|
+
{% endif %}
|
|
108
|
+
</div>
|
|
109
|
+
{% endif %}
|
|
110
|
+
</div>
|
|
111
|
+
{{ _item.thumbnail }}
|
|
112
|
+
</a>
|
|
113
|
+
</li>
|
|
114
|
+
{% if loop.index % 5 == 0 or loop.last %}
|
|
115
|
+
</ul>
|
|
116
|
+
{% endif %}
|
|
117
|
+
{% if loop.last %}
|
|
118
|
+
</div>
|
|
119
|
+
{% endif %}
|
|
120
|
+
{% if loop.index > _max_visible_thumbnails and loop.last %}
|
|
121
|
+
</div>
|
|
122
|
+
<div class="bg-lighter py-3 px-4 mt-2 rounded text-center">
|
|
123
|
+
<a
|
|
124
|
+
class="bcl-gallery__collapse standalone d-none d-sm-inline-block"
|
|
125
|
+
aria-controls="{{ _collpase_id }}"
|
|
126
|
+
data-bs-toggle="collapse"
|
|
127
|
+
aria-expanded="false"
|
|
128
|
+
role="button"
|
|
129
|
+
href="#{{ _collpase_id }}"
|
|
130
|
+
>
|
|
131
|
+
<span class="label-collapsed">{{ _toggle_collapsed|replace({'%d': _items|length}) }}</span>
|
|
132
|
+
<span class="label-expanded">{{ _toggle_expanded }}</span>
|
|
133
|
+
{% include '@oe-bcl/bcl-icon/icon.html.twig' with {
|
|
134
|
+
name: 'caret-down-fill',
|
|
135
|
+
size: '2xs',
|
|
136
|
+
path: _icon_path,
|
|
137
|
+
attributes: create_attribute().addClass('ms-2-5'),
|
|
138
|
+
} only %}
|
|
139
|
+
</a>
|
|
140
|
+
<a
|
|
141
|
+
class="bcl-gallery__mobile-view-more standalone d-inline-block d-sm-none"
|
|
142
|
+
data-bs-target="#{{ _carousel_id }}"
|
|
143
|
+
data-bs-slide-to="{{ _max_visible_thumbnails - 1 }}"
|
|
144
|
+
role="button"
|
|
145
|
+
href="#"
|
|
146
|
+
>
|
|
147
|
+
<span data-bs-target="#{{ _modal_id }}" data-bs-toggle="modal">
|
|
148
|
+
<span class="label-collapsed">{{ _toggle_collapsed|replace({'%d': _items|length}) }}</span>
|
|
149
|
+
{% include '@oe-bcl/bcl-icon/icon.html.twig' with {
|
|
150
|
+
name: 'caret-down-fill',
|
|
151
|
+
size: '2xs',
|
|
152
|
+
path: _icon_path,
|
|
153
|
+
attributes: create_attribute().addClass('ms-2-5'),
|
|
154
|
+
} only %}
|
|
155
|
+
<span>
|
|
156
|
+
</a>
|
|
157
|
+
</div>
|
|
158
|
+
{% endif %}
|
|
159
|
+
{% endfor %}
|
|
160
|
+
{% endif %}
|
|
161
|
+
|
|
162
|
+
<div class="modal" id="{{ _modal_id }}" tabindex="-1" aria-labelledby="{{ _modal_id }}" aria-hidden="true" data-bs-backdrop="false">
|
|
163
|
+
<div class="modal-dialog modal-dialog-centered modal-fullscreen">
|
|
164
|
+
<div class="modal-content">
|
|
165
|
+
<div class="modal-header border-0 justify-content-between">
|
|
166
|
+
{% if _title is not empty %}
|
|
167
|
+
<div class="modal-title">
|
|
168
|
+
<h3 class="d-none d-sm-block">{{- _title -}}</h3>
|
|
169
|
+
</div>
|
|
170
|
+
{% endif %}
|
|
171
|
+
<div class="carousel-pager">
|
|
172
|
+
<span>1</span> / {{ _items|length }}
|
|
173
|
+
</div>
|
|
174
|
+
<div class="modal-close">
|
|
175
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
<div class="modal-body d-flex align-items-center justify-content-center">
|
|
180
|
+
{% for _item in _items %}
|
|
181
|
+
{% set _carousel_items = _carousel_items|merge([_item|merge({
|
|
182
|
+
caption: ('<iframe' in _item.media or '<video' in _item.media) ? '' : _item.caption,
|
|
183
|
+
image: ('<iframe' in _item.media or '<img' in _item.media) ? _item.media|replace({'src=': 'data-src='}) : _item.media,
|
|
184
|
+
})]) %}
|
|
185
|
+
{% endfor %}
|
|
186
|
+
{% include '@oe-bcl/bcl-carousel/carousel.html.twig' with {
|
|
187
|
+
id: _carousel_id,
|
|
188
|
+
with_controls: true,
|
|
189
|
+
with_indicators: false,
|
|
190
|
+
prev_label: _prev_label,
|
|
191
|
+
next_label: _next_label,
|
|
192
|
+
autoplay: false,
|
|
193
|
+
items: _carousel_items,
|
|
194
|
+
} only %}
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
{% endif %}
|
|
202
|
+
|
|
203
|
+
{% endspaceless %}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
classes: _image_classes,
|
|
57
57
|
})}) %}
|
|
58
58
|
{% elseif _card.date is not empty %}
|
|
59
|
-
{% set _max_width = 'mw-date mb-3' %}
|
|
59
|
+
{% set _max_width = 'mw-col-date mb-3' %}
|
|
60
60
|
{% endif %}
|
|
61
61
|
{% if _alignment is not empty %}
|
|
62
62
|
{% set _alignment_class = ' align-self-' ~ _alignment %}
|