@openeuropa/bcl-twig-templates 0.4298.202511051800 → 0.4360.202601141610

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.
Files changed (84) hide show
  1. package/package.json +67 -67
  2. package/templates/bcl-accordion/accordion.html.twig +42 -46
  3. package/templates/bcl-alert/alert.html.twig +18 -21
  4. package/templates/bcl-badge/badge.html.twig +11 -15
  5. package/templates/bcl-banner/banner.html.twig +34 -37
  6. package/templates/bcl-base-templates/content-type.html.twig +63 -67
  7. package/templates/bcl-base-templates/listing-page.html.twig +31 -31
  8. package/templates/bcl-base-templates/sidebar-search.html.twig +10 -10
  9. package/templates/bcl-blockquote/blockquote.html.twig +17 -20
  10. package/templates/bcl-breadcrumb/breadcrumb.html.twig +24 -28
  11. package/templates/bcl-button/button.html.twig +24 -27
  12. package/templates/bcl-button-group/button-group.html.twig +25 -29
  13. package/templates/bcl-card/card.html.twig +98 -101
  14. package/templates/bcl-card-layout/card-layout.html.twig +34 -37
  15. package/templates/bcl-carousel/carousel.html.twig +64 -67
  16. package/templates/bcl-contact-form/contact-form.html.twig +1 -1
  17. package/templates/bcl-content-banner/content-banner.html.twig +37 -40
  18. package/templates/bcl-date-block/date-block.html.twig +26 -29
  19. package/templates/bcl-description-list/description-list-details.html.twig +6 -9
  20. package/templates/bcl-description-list/description-list-title.html.twig +11 -14
  21. package/templates/bcl-description-list/description-list.html.twig +44 -48
  22. package/templates/bcl-dropdown/dropdown.html.twig +48 -52
  23. package/templates/bcl-event/event.html.twig +7 -7
  24. package/templates/bcl-fact-figures/fact-figures.html.twig +34 -37
  25. package/templates/bcl-featured-media/featured-media.html.twig +42 -46
  26. package/templates/bcl-file/file-translations.html.twig +29 -32
  27. package/templates/bcl-file/file.html.twig +47 -50
  28. package/templates/bcl-footer/footer.html.twig +31 -34
  29. package/templates/bcl-form/form.html.twig +70 -73
  30. package/templates/bcl-form-input/form-input.html.twig +57 -61
  31. package/templates/bcl-gallery/gallery-item.html.twig +20 -23
  32. package/templates/bcl-gallery/gallery.html.twig +62 -66
  33. package/templates/bcl-glossary/glossary-detail.html.twig +19 -19
  34. package/templates/bcl-glossary/glossary-listing.html.twig +6 -6
  35. package/templates/bcl-group/group-landing.html.twig +69 -69
  36. package/templates/bcl-group/group.html.twig +19 -19
  37. package/templates/bcl-header/header.html.twig +71 -82
  38. package/templates/bcl-heading/heading.html.twig +13 -17
  39. package/templates/bcl-icon/icon.html.twig +10 -13
  40. package/templates/bcl-inpage-navigation/inpage-navigation.html.twig +20 -23
  41. package/templates/bcl-landing-page/landing-page.html.twig +33 -33
  42. package/templates/bcl-language-list/language-list-grid.html.twig +25 -28
  43. package/templates/bcl-language-list/language-list-modal.html.twig +52 -52
  44. package/templates/bcl-language-list/language-list.html.twig +33 -37
  45. package/templates/bcl-language-switcher/language-switcher.html.twig +12 -15
  46. package/templates/bcl-link/link.html.twig +24 -27
  47. package/templates/bcl-links-block/links-block.html.twig +30 -34
  48. package/templates/bcl-list-group/list-group.html.twig +43 -47
  49. package/templates/bcl-listing/listing.html.twig +88 -91
  50. package/templates/bcl-mega-menu/mega-menu-items.html.twig +18 -21
  51. package/templates/bcl-mega-menu/mega-menu-submenu.html.twig +28 -26
  52. package/templates/bcl-mega-menu/mega-menu.html.twig +37 -38
  53. package/templates/bcl-modal/modal.html.twig +21 -23
  54. package/templates/bcl-navbar/navbar.html.twig +35 -38
  55. package/templates/bcl-navigation/navigation.html.twig +105 -110
  56. package/templates/bcl-offcanvas/offcanvas.html.twig +33 -36
  57. package/templates/bcl-page/page.html.twig +27 -27
  58. package/templates/bcl-pagination/pagination-item.html.twig +22 -26
  59. package/templates/bcl-pagination/pagination.html.twig +59 -62
  60. package/templates/bcl-pagination-v2/pagination-item.html.twig +31 -35
  61. package/templates/bcl-pagination-v2/pagination.html.twig +79 -82
  62. package/templates/bcl-person/person.html.twig +12 -12
  63. package/templates/bcl-placeholder/placeholder.html.twig +14 -18
  64. package/templates/bcl-progress/progress.html.twig +16 -20
  65. package/templates/bcl-project/project-lists.html.twig +25 -29
  66. package/templates/bcl-project/project.html.twig +35 -35
  67. package/templates/bcl-project-status/project-contributions.html.twig +25 -28
  68. package/templates/bcl-project-status/project-status.html.twig +32 -37
  69. package/templates/bcl-recent-activities/recent-activities.html.twig +13 -16
  70. package/templates/bcl-search/search.html.twig +12 -12
  71. package/templates/bcl-search-form/search-form.html.twig +21 -24
  72. package/templates/bcl-select/select.html.twig +52 -56
  73. package/templates/bcl-spinner/spinner.html.twig +10 -13
  74. package/templates/bcl-subscription/subscription-modal.html.twig +7 -7
  75. package/templates/bcl-subscription/subscription.html.twig +3 -3
  76. package/templates/bcl-subscription-block/subscription-block.html.twig +14 -17
  77. package/templates/bcl-table/table.html.twig +61 -65
  78. package/templates/bcl-textarea/textarea.html.twig +44 -47
  79. package/templates/bcl-timeline/timeline-item.html.twig +12 -15
  80. package/templates/bcl-timeline/timeline.html.twig +42 -45
  81. package/templates/bcl-toasts/toasts.html.twig +56 -60
  82. package/templates/bcl-user/user-compact.html.twig +24 -27
  83. package/templates/bcl-user/user-terms.html.twig +6 -6
  84. package/templates/bcl-user/user.html.twig +117 -117
@@ -1,5 +1,3 @@
1
- {% apply spaceless %}
2
-
3
1
  {# Parameters:
4
2
  - title: (string) (default: '')
5
3
  - title_tag: (string) (default: 'h1')
@@ -51,8 +49,8 @@
51
49
  - card_links
52
50
  #}
53
51
 
54
- {% set _title = title|default('') %}
55
- {% set _title_tag = title_tag|default('h1') %}
52
+ {%- set _title = title|default('') %}
53
+ {% set _title_tag = title_tag|default('div') %}
56
54
  {% set _title_link = title_link|default({}) %}
57
55
  {% set _title_attributes = title_attributes ?: create_attribute() %}
58
56
  {% set _subtitle = subtitle|default({}) %}
@@ -77,112 +75,112 @@
77
75
  {% set _badges = badges|default([]) %}
78
76
  {% set _links = links|default([]) %}
79
77
 
80
- {% set _classes = ['card'] %}
78
+ {%- set _classes = ['card'] %}
81
79
  {% if _text_color is not empty %}
82
- {% set _classes = _classes|merge(['text-' ~ _text_color]) %}
80
+ {%- set _classes = _classes|merge(['text-' ~ _text_color]) %}
83
81
  {% endif %}
84
82
  {% if _variant is not empty %}
85
- {% set _classes = _classes|merge(['text-bg-' ~ _variant]) %}
83
+ {%- set _classes = _classes|merge(['text-bg-' ~ _variant]) %}
86
84
  {% endif %}
87
85
  {% if _border_variant is not empty %}
88
- {% set _classes = _classes|merge(['border-' ~ _border_variant]) %}
86
+ {%- set _classes = _classes|merge(['border-' ~ _border_variant]) %}
89
87
  {% endif %}
90
88
 
91
- {% if attributes is empty %}
92
- {% set attributes = create_attribute() %}
89
+ {%- if attributes is empty %}
90
+ {%- set attributes = create_attribute() %}
93
91
  {% endif %}
94
92
 
95
- {% set _body_classes = 'card-body' %}
93
+ {%- set _body_classes = 'card-body' %}
96
94
  {% if _extra_classes_body is not empty %}
97
- {% set _body_classes = _body_classes ~ ' ' ~ _extra_classes_body %}
95
+ {%- set _body_classes = _body_classes ~ ' ' ~ _extra_classes_body %}
98
96
  {% endif %}
99
97
 
100
- {% set _header_classes = 'card-header' %}
98
+ {%- set _header_classes = 'card-header' %}
101
99
  {% if _extra_classes_header is not empty %}
102
- {% set _header_classes = _header_classes ~ ' ' ~ _extra_classes_header %}
100
+ {%- set _header_classes = _header_classes ~ ' ' ~ _extra_classes_header %}
103
101
  {% endif %}
104
102
 
105
- {% set _footer_classes = 'card-footer' %}
103
+ {%- set _footer_classes = 'card-footer' %}
106
104
  {% if _extra_classes_footer is not empty %}
107
- {% set _footer_classes = _footer_classes ~ ' ' ~ _extra_classes_footer %}
105
+ {%- set _footer_classes = _footer_classes ~ ' ' ~ _extra_classes_footer %}
108
106
  {% endif %}
109
107
 
110
- {% set _row_classes = 'row' %}
108
+ {%- set _row_classes = 'row' %}
111
109
  {% if _horizontal_grid.gutter is not empty %}
112
- {% set _row_classes = _row_classes ~ ' g-' ~ _horizontal_grid.gutter %}
110
+ {%- set _row_classes = _row_classes ~ ' g-' ~ _horizontal_grid.gutter %}
113
111
  {% endif %}
114
112
 
115
- {% set attributes = attributes.addClass(_classes) %}
113
+ {%- set attributes = attributes.addClass(_classes) -%}
116
114
 
117
115
  <article
118
116
  {{ attributes }}
119
117
  >
120
- {% if _card_header is not empty %}
118
+ {%- if _card_header is not empty -%}
121
119
  <div class='{{ _header_classes }}'>
122
120
  {{- _card_header -}}
123
121
  </div>
124
- {% endif %}
125
- {% if _horizontal %}
122
+ {%- endif %}
123
+ {% if _horizontal -%}
126
124
  <div class='{{ _row_classes }}'>
127
- {% endif %}
125
+ {%- endif %}
128
126
  {% if _image is not empty and _image.position != 'bottom' %}
129
- {% set _img_class = 'card-img-top' %}
130
- {% if _image.position == 'background' %}
131
- {% set _img_class = 'card-img' %}
132
- {% endif %}
133
- {% if _image.rounded is not empty %}
134
- {% set _img_class = _img_class ~ ' rounded-' ~ _image.rounded %}
135
- {% elseif _horizontal %}
136
- {% if attributes.hasClass('border-0') %}
137
- {% set _img_class = _img_class ~ ' rounded-1' %}
138
- {% else %}
139
- {% set _img_class = _img_class ~ ' rounded-0 rounded-start' %}
140
- {% endif %}
141
- {% elseif _card_header is not empty %}
142
- {% set _img_class = _img_class ~ ' rounded-0' %}
143
- {% endif %}
144
- {% if _image.classes is not empty %}
145
- {% set _img_class = _img_class ~ " " ~ _image.classes %}
146
- {% endif %}
147
- {% endif %}
148
- {% if _horizontal and (_image is not empty or _date is not empty) %}
149
- <div class='{{ _horizontal_grid.left_col_classes }}'>
127
+ {%- set _img_class = 'card-img-top' %}
128
+ {%- if _image.position == 'background' %}
129
+ {%- set _img_class = 'card-img' %}
130
+ {%- endif %}
131
+ {%- if _image.rounded is not empty %}
132
+ {%- set _img_class = _img_class ~ ' rounded-' ~ _image.rounded %}
133
+ {%- elseif _horizontal %}
134
+ {%- if attributes.hasClass('border-0') %}
135
+ {%- set _img_class = _img_class ~ ' rounded-1' %}
136
+ {%- else %}
137
+ {%- set _img_class = _img_class ~ ' rounded-0 rounded-start' %}
138
+ {%- endif %}
139
+ {%- elseif _card_header is not empty %}
140
+ {%- set _img_class = _img_class ~ ' rounded-0' %}
141
+ {%- endif %}
142
+ {%- if _image.classes is not empty %}
143
+ {%- set _img_class = _img_class ~ " " ~ _image.classes %}
144
+ {%- endif %}
150
145
  {% endif %}
151
- {% if _date is not empty %}
152
- {% block card_date %}
153
- {% include '@oe-bcl/bcl-date-block/date-block.html.twig' with _date only %}
154
- {% endblock %}
155
- {% elseif _image is not empty and _image.position != "bottom" %}
146
+ {% if _horizontal and (_image is not empty or _date is not empty) -%}
147
+ <div class='{{ _horizontal_grid.left_col_classes }}'>
148
+ {%- endif %}
149
+ {%- if _date is not empty %}
150
+ {%- block card_date %}
151
+ {%- include '@oe-bcl/bcl-date-block/date-block.html.twig' with _date only %}
152
+ {%- endblock %}
153
+ {%- elseif _image is not empty and _image.position != "bottom" -%}
156
154
  <img
157
155
  src="{{ _image.path }}"
158
156
  alt="{{ _image.alt }}"
159
157
  class="{{ _img_class }}"
160
158
  >
161
- {% endif %}
162
- {% if _horizontal and (_image is not empty or _date is not empty) %}
159
+ {%- endif %}
160
+ {% if _horizontal and (_image is not empty or _date is not empty) -%}
163
161
  </div>
164
- {% endif %}
165
- {% if _image.position == 'background' %}
162
+ {%- endif %}
163
+ {% if _image.position == 'background' -%}
166
164
  <div class="card-img-overlay">
167
- {% endif %}
168
- {% if _horizontal %}
165
+ {%- endif %}
166
+ {% if _horizontal -%}
169
167
  <div class='{{ _horizontal_grid.right_col_classes }}'>
170
- {% endif %}
168
+ {%- endif -%}
171
169
  <div class='{{ _body_classes }}'>
172
- {% if _title is not empty %}
173
- {% if _title_attributes.class is empty %}
174
- {% set _title_attributes = _title_attributes.addClass('fs-4') %}
175
- {% endif %}
176
- {% set _title_attributes = _title_attributes.addClass('card-title') %}
177
- {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
170
+ {%- if _title is not empty %}
171
+ {%- if _title_attributes.class is empty %}
172
+ {%- set _title_attributes = _title_attributes.addClass('h4') %}
173
+ {%- endif %}
174
+ {%- set _title_attributes = _title_attributes.addClass('card-title') %}
175
+ {%- include '@oe-bcl/bcl-heading/heading.html.twig' with {
178
176
  title: _title,
179
177
  title_tag: _title_tag,
180
178
  title_link: _title_link,
181
179
  attributes: _title_attributes,
182
180
  } only %}
183
- {% endif %}
181
+ {%- endif %}
184
182
  {%- if _subtitle is not empty -%}
185
- {% set _subtitle_tag = _subtitle.tag ?? 'h6' %}
183
+ {% set _subtitle_tag = _subtitle.tag ?? 'h6' -%}
186
184
  <{{ _subtitle_tag }}
187
185
  class='card-subtitle{{ _subtitle.classes ? ' ' ~ _subtitle.classes }}'
188
186
  >
@@ -190,7 +188,7 @@
190
188
  </{{ _subtitle_tag }}>
191
189
  {%- endif -%}
192
190
  {%- if _text is not empty -%}
193
- {% set _text_tag = _text.tag ?? 'p' %}
191
+ {% set _text_tag = _text.tag ?? 'p' -%}
194
192
  <{{ _text_tag }}
195
193
  class='card-text{{ _text.classes ? ' ' ~ _text.classes }}'
196
194
  >
@@ -203,73 +201,72 @@
203
201
  {% block card_badges %}
204
202
  {%- if _badges is not empty and _badges is iterable -%}
205
203
  <div class="mt-2-5">
206
- {% for _badge in _badges %}
207
- {% if _badge.attributes is empty %}
208
- {% set _badge = _badge|merge({
204
+ {%- for _badge in _badges %}
205
+ {%- if _badge.attributes is empty %}
206
+ {%- set _badge = _badge|merge({
209
207
  attributes: create_attribute()
210
208
  }) %}
211
- {% endif %}
212
- {% set _badge = _badge|merge({
209
+ {%- endif %}
210
+ {%- set _badge = _badge|merge({
213
211
  attributes: _badge.attributes.addClass('mb-2')
214
212
  })
215
213
  %}
216
- {% if not loop.last %}
217
- {% set _badge = _badge|merge({
214
+ {%- if not loop.last %}
215
+ {%- set _badge = _badge|merge({
218
216
  attributes: _badge.attributes.addClass('me-2')
219
217
  })
220
218
  %}
221
- {% endif %}
222
- {% include '@oe-bcl/bcl-badge/badge.html.twig' with _badge only %}
223
-
224
- {% endfor %}
219
+ {%- endif %}
220
+ {%- include '@oe-bcl/bcl-badge/badge.html.twig' with _badge only %}
221
+
222
+ {%- endfor -%}
225
223
  </div>
226
224
  {%- endif -%}
227
225
  {% endblock %}
228
- {% block card_links %}
226
+ {%- block card_links %}
229
227
  {%- if _links is not empty and _links is iterable -%}
230
228
  <div class="mt-2-5 mb-2">
231
- {% for _link in _links %}
229
+ {%- for _link in _links -%}
232
230
  <div class="mb-3 mb-md-0 d-block d-md-inline-block me-md-4-5">
233
- {% include '@oe-bcl/bcl-link/link.html.twig' with _link only %}
231
+ {%- include '@oe-bcl/bcl-link/link.html.twig' with _link only -%}
234
232
  </div>
235
- {% endfor %}
233
+ {%- endfor -%}
236
234
  </div>
237
235
  {%- endif -%}
238
- {% endblock %}
236
+ {% endblock -%}
239
237
  </div>
240
- {% if _horizontal %}
238
+ {%- if _horizontal -%}
241
239
  </div>
242
- {% endif %}
240
+ {%- endif %}
243
241
  {% if _image is not empty %}
244
- {% if _image.position == 'background' %}
242
+ {%- if _image.position == 'background' -%}
245
243
  </div>
246
- {% endif %}
247
- {% set _img_class = "card-img-bottom" %}
248
- {% if _image.classes is not empty %}
249
- {% set _img_class = _img_class ~ " " ~ _image.classes %}
250
- {% endif %}
251
- {% if _image.position == 'bottom' %}
252
- {% if _horizontal %}
244
+ {%- endif %}
245
+ {%- set _img_class = "card-img-bottom" %}
246
+ {%- if _image.classes is not empty %}
247
+ {%- set _img_class = _img_class ~ " " ~ _image.classes %}
248
+ {%- endif %}
249
+ {%- if _image.position == 'bottom' %}
250
+ {%- if _horizontal -%}
253
251
  <div class="col-4">
254
- {% endif %}
252
+ {%- endif -%}
255
253
  <img
256
254
  src="{{ _image.path }}"
257
255
  alt="{{ _image.alt }}"
258
256
  class="{{ _img_class }}"
259
257
  >
260
- {% if _horizontal %}
258
+ {%- if _horizontal -%}
261
259
  </div>
262
- {% endif %}
263
- {% endif %}
260
+ {%- endif %}
261
+ {%- endif %}
264
262
  {% endif %}
265
- {% if _horizontal %}
263
+ {% if _horizontal -%}
266
264
  </div>
267
- {% endif %}
268
- {% if _card_footer is not empty %}
265
+ {%- endif %}
266
+ {% if _card_footer is not empty -%}
269
267
  <div class="{{ _footer_classes }}">
270
268
  {{- _card_footer -}}
271
269
  </div>
272
- {% endif %}
270
+ {%- endif -%}
273
271
  </article>
274
-
275
- {% endapply %}
272
+ {#--#}
@@ -1,5 +1,3 @@
1
- {% apply spaceless %}
2
-
3
1
  {# Parameters:
4
2
  - type (string) (default: 'group')
5
3
  options: ['group', 'grid', 'masonry']
@@ -20,7 +18,7 @@
20
18
  - card_layout_card
21
19
  #}
22
20
 
23
- {% set _type = type|default('group') %}
21
+ {%- set _type = type|default('group') %}
24
22
  {% set _items = items|default([]) %}
25
23
  {% set _grid_columns = grid_columns|default(1) %}
26
24
  {% set _responsiveness = responsiveness|default('md') %}
@@ -29,59 +27,58 @@
29
27
  {% set _equal_height = equal_height ?? false %}
30
28
  {% set _cols_extra_classes = cols_extra_classes|default('') %}
31
29
 
32
- {% set _cols_classes = 'col' %}
30
+ {%- set _cols_classes = 'col' %}
33
31
 
34
- {% if _cols_extra_classes is not empty %}
35
- {% set _cols_classes = _cols_classes ~ ' ' ~ _cols_extra_classes %}
32
+ {%- if _cols_extra_classes is not empty %}
33
+ {%- set _cols_classes = _cols_classes ~ ' ' ~ _cols_extra_classes %}
36
34
  {% endif %}
37
35
  {% if _type == 'group' %}
38
- {% set _classes = ['card-group'] %}
36
+ {%- set _classes = ['card-group'] %}
39
37
  {% elseif type == 'grid' or type == 'masonry' %}
40
- {% set _classes = ['row', 'row-cols-' ~ _grid_columns] %}
41
- {% if _responsive_columns is not empty %}
42
- {% set _classes = _classes|merge(['row-cols-' ~ _responsiveness ~ '-' ~ _responsive_columns]) %}
43
- {% endif %}
44
- {% if _gutter is not empty %}
45
- {% set _classes = _classes|merge(['g-' ~ _gutter]) %}
46
- {% endif %}
38
+ {%- set _classes = ['row', 'row-cols-' ~ _grid_columns] %}
39
+ {%- if _responsive_columns is not empty %}
40
+ {%- set _classes = _classes|merge(['row-cols-' ~ _responsiveness ~ '-' ~ _responsive_columns]) %}
41
+ {%- endif %}
42
+ {%- if _gutter is not empty %}
43
+ {%- set _classes = _classes|merge(['g-' ~ _gutter]) %}
44
+ {%- endif %}
47
45
  {% endif %}
48
46
 
49
- {% if attributes is empty %}
50
- {% set attributes = create_attribute() %}
47
+ {%- if attributes is empty %}
48
+ {%- set attributes = create_attribute() %}
51
49
  {% endif %}
52
50
 
53
- {% set attributes = attributes.addClass(_classes) %}
51
+ {%- set attributes = attributes.addClass(_classes) -%}
54
52
 
55
53
  <div
56
54
  {{ attributes }}
57
- {% if _type == 'masonry' %}
55
+ {%- if _type == 'masonry' %}
58
56
  data-masonry='{"percentPosition": true }'
59
57
  {% endif %}
60
58
  >
61
- {% if _items is not empty and _items is iterable %}
62
- {% for _item in _items %}
63
- {% if _item.attributes is empty %}
64
- {% set _item = _item|merge({
59
+ {%- if _items is not empty and _items is iterable %}
60
+ {%- for _item in _items %}
61
+ {%- if _item.attributes is empty %}
62
+ {%- set _item = _item|merge({
65
63
  attributes: create_attribute()
66
64
  }) %}
67
- {% endif %}
68
- {% if _equal_height %}
69
- {% set _item = _item|merge({
65
+ {%- endif %}
66
+ {%- if _equal_height %}
67
+ {%- set _item = _item|merge({
70
68
  attributes: _item.attributes.addClass('h-100')
71
69
  })
72
70
  %}
73
- {% endif %}
74
- {% if _type == 'grid' or _type == 'masonry' %}
71
+ {%- endif %}
72
+ {%- if _type == 'grid' or _type == 'masonry' -%}
75
73
  <div class="{{ _cols_classes }}">
76
- {% endif %}
77
- {% block card_layout_card %}
78
- {% include '@oe-bcl/bcl-card/card.html.twig' with _item only %}
79
- {% endblock %}
80
- {% if _type == 'grid' or _type == 'masonry' %}
74
+ {%- endif %}
75
+ {%- block card_layout_card %}
76
+ {%- include '@oe-bcl/bcl-card/card.html.twig' with _item only %}
77
+ {%- endblock %}
78
+ {%- if _type == 'grid' or _type == 'masonry' -%}
81
79
  </div>
82
- {% endif %}
83
- {% endfor %}
84
- {% endif %}
80
+ {%- endif %}
81
+ {%- endfor %}
82
+ {% endif -%}
85
83
  </div>
86
-
87
- {% endapply %}
84
+ {#--#}
@@ -1,5 +1,3 @@
1
- {% apply spaceless %}
2
-
3
1
  {# Parameters:
4
2
  - title (string) (default: '')
5
3
  - title_tag (string) (default: 'h2')
@@ -14,7 +12,7 @@
14
12
  image: (string) <img> tag
15
13
  caption (string)
16
14
  caption_classes (string)
17
- caption_title (string)
15
+ caption_title (string)
18
16
  interval (integer) (default: 0)
19
17
  }
20
18
  ],
@@ -28,7 +26,7 @@
28
26
  - attributes (drupal attrs)
29
27
  #}
30
28
 
31
- {% set _title = title|default('') %}
29
+ {%- set _title = title|default('') %}
32
30
  {% set _title_tag = title_tag|default('h2') %}
33
31
  {% set _title_link = title_link|default({}) %}
34
32
  {% set _title_attributes = title_attributes ?: create_attribute() %}
@@ -45,36 +43,36 @@
45
43
  {% set _rounded_indicators = rounded_indicators ?? false %}
46
44
  {% set _disable_touch = disable_touch ?? false %}
47
45
 
48
- {% set _classes = ['carousel', 'slide'] %}
46
+ {%- set _classes = ['carousel', 'slide'] %}
49
47
 
50
- {% if _fade %}
51
- {% set _classes = _classes|merge(['carousel-fade']) %}
48
+ {%- if _fade %}
49
+ {%- set _classes = _classes|merge(['carousel-fade']) %}
52
50
  {% endif %}
53
51
  {% if _dark %}
54
- {% set _classes = _classes|merge(['carousel-dark']) %}
52
+ {%- set _classes = _classes|merge(['carousel-dark']) %}
55
53
  {% endif %}
56
54
 
57
- {% if attributes is empty %}
58
- {% set attributes = create_attribute() %}
55
+ {%- if attributes is empty %}
56
+ {%- set attributes = create_attribute() %}
59
57
  {% endif %}
60
58
 
61
- {% if _id is not empty %}
62
- {% set attributes = attributes.setAttribute('id', _id) %}
59
+ {%- if _id is not empty %}
60
+ {%- set attributes = attributes.setAttribute('id', _id) %}
63
61
  {% endif %}
64
62
 
65
- {% if _autoplay %}
66
- {% set attributes = attributes.setAttribute('data-bs-ride', 'carousel') %}
63
+ {%- if _autoplay %}
64
+ {%- set attributes = attributes.setAttribute('data-bs-ride', 'carousel') %}
67
65
  {% endif %}
68
66
 
69
- {% if _disable_touch %}
70
- {% set attributes = attributes.setAttribute('data-bs-touch', 'false') %}
67
+ {%- if _disable_touch %}
68
+ {%- set attributes = attributes.setAttribute('data-bs-touch', 'false') %}
71
69
  {% endif %}
72
70
 
73
- {% if _rounded_indicators %}
74
- {% set attributes = attributes.addClass('rounded-indicators') %}
71
+ {%- if _rounded_indicators %}
72
+ {%- set attributes = attributes.addClass('rounded-indicators') %}
75
73
  {% endif %}
76
74
 
77
- {% set attributes = attributes.addClass(_classes) %}
75
+ {%- set attributes = attributes.addClass(_classes) %}
78
76
 
79
77
  {%- if _title is not empty -%}
80
78
  {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
@@ -88,93 +86,92 @@
88
86
  <div
89
87
  {{ attributes }}
90
88
  >
91
- {% if _with_indicators %}
89
+ {%- if _with_indicators -%}
92
90
  <div class="carousel-indicators d-none d-md-flex">
93
- {% for _i in 0..(_items|length - 1) %}
94
- {% set button_attributes = create_attribute()
91
+ {%- for _i in 0..(_items|length - 1) %}
92
+ {%- set button_attributes = create_attribute()
95
93
  .setAttribute('aria-label', 'Slide ' ~ (_i + 1))
96
94
  .setAttribute('data-bs-target', '#' ~ _id)
97
95
  .setAttribute('data-bs-slide-to', _i)
98
96
  %}
99
- {% if loop.index == _active_item %}
100
- {% set button_attributes = button_attributes.setAttribute('aria-current', true).addClass(['active']) %}
101
- {% endif %}
102
- {% include '@oe-bcl/bcl-button/button.html.twig' with {
97
+ {%- if loop.index == _active_item %}
98
+ {%- set button_attributes = button_attributes.setAttribute('aria-current', true).addClass(['active']) %}
99
+ {%- endif %}
100
+ {%- include '@oe-bcl/bcl-button/button.html.twig' with {
103
101
  clean_class: true,
104
102
  attributes: button_attributes
105
103
  } only %}
106
- {% endfor %}
104
+ {%- endfor -%}
107
105
  </div>
108
- {% endif %}
106
+ {%- endif -%}
109
107
  <div class="carousel-inner">
110
- {% if _items is not empty and _items is iterable %}
111
- {% for _item in items %}
112
- {% set _item_classes = 'carousel-item' %}
113
- {% if loop.index == _active_item %}
114
- {% set _item_classes = _item_classes ~ ' active' %}
115
- {% endif %}
108
+ {%- if _items is not empty and _items is iterable %}
109
+ {%- for _item in items %}
110
+ {%- set _item_classes = 'carousel-item' %}
111
+ {%- if loop.index == _active_item %}
112
+ {%- set _item_classes = _item_classes ~ ' active' %}
113
+ {%- endif -%}
116
114
  <div
117
115
  class="{{ _item_classes }}"
118
116
  {% if _item.interval is defined %}
119
117
  data-bs-interval="{{ _item.interval }}"
120
118
  {% endif %}
121
119
  >
122
- {% if _item.image is defined and _item.image is not empty %}
123
- {{ _item.image }}
124
- {% endif %}
125
- {% if (_item.caption is defined and _item.caption is not empty) or (_item.link is defined and _item.link is not empty) or (_item.caption_title is defined and _item.caption_title is not empty) %}
126
- {% set _caption_classes = 'carousel-caption' %}
127
- {% if _item.caption is not empty and _item.link is empty %}
128
- {% set _caption_classes = _caption_classes ~ ' d-none d-md-block' %}
129
- {% endif %}
120
+ {%- if _item.image is defined and _item.image is not empty %}
121
+ {{- _item.image }}
122
+ {%- endif %}
123
+ {%- if (_item.caption is defined and _item.caption is not empty) or (_item.link is defined and _item.link is not empty) or (_item.caption_title is defined and _item.caption_title is not empty) %}
124
+ {%- set _caption_classes = 'carousel-caption' %}
125
+ {%- if _item.caption is not empty and _item.link is empty %}
126
+ {%- set _caption_classes = _caption_classes ~ ' d-none d-md-block' %}
127
+ {%- endif -%}
130
128
  <div
131
129
  class="{{ _caption_classes }}"
132
130
  >
133
- {% if _item.caption is not empty or _item.caption_title is not empty %}
134
- {% if _item.caption_classes is defined and _item.caption_classes is not empty %}
131
+ {%- if _item.caption is not empty or _item.caption_title is not empty %}
132
+ {%- if _item.caption_classes is defined and _item.caption_classes is not empty -%}
135
133
  <div class="{{ _item.caption_classes }}">
136
- {% endif %}
137
- {% if _item.caption_title is not empty %}
134
+ {%- endif %}
135
+ {%- if _item.caption_title is not empty -%}
138
136
  <div class="fs-5">{{ _item.caption_title }}</div>
139
- {% endif %}
137
+ {%- endif %}
140
138
  {{- _item.caption -}}
141
- {% if _item.caption_classes is defined and _item.caption_classes is not empty %}
139
+ {% if _item.caption_classes is defined and _item.caption_classes is not empty -%}
142
140
  </div>
143
- {% endif %}
144
- {% endif %}
145
- {% if _item.link is defined and _item.link is not empty %}
146
- {% include '@oe-bcl/bcl-link/link.html.twig' with _item.link only %}
147
- {% endif %}
141
+ {%- endif %}
142
+ {%- endif %}
143
+ {%- if _item.link is defined and _item.link is not empty %}
144
+ {%- include '@oe-bcl/bcl-link/link.html.twig' with _item.link only %}
145
+ {%- endif -%}
148
146
  </div>
149
- {% endif %}
147
+ {%- endif -%}
150
148
  </div>
151
- {% endfor %}
152
- {% endif %}
149
+ {%- endfor %}
150
+ {%- endif -%}
153
151
  </div>
154
- {% if _with_controls %}
152
+ {%- if _with_controls -%}
155
153
  <button
156
154
  class="carousel-control-prev"
157
155
  type="button"
158
156
  data-bs-target="#{{ _id }}"
159
157
  data-bs-slide="prev"
160
- >
158
+ >{# -#}
161
159
  <span class="carousel-control-prev-icon"></span>
162
- {% if _prev_label is not empty %}
160
+ {%- if _prev_label is not empty -%}
163
161
  <span class="visually-hidden">{{ _prev_label }}</span>
164
- {% endif %}
165
- </button>
162
+ {%- endif -%}
163
+ </button>{# -#}
166
164
  <button
167
165
  class="carousel-control-next"
168
166
  type="button"
169
167
  data-bs-target="#{{ _id }}"
170
168
  data-bs-slide="next"
171
- >
169
+ >{# -#}
172
170
  <span class="carousel-control-next-icon"></span>
173
- {% if _next_label is not empty %}
171
+ {%- if _next_label is not empty -%}
174
172
  <span class="visually-hidden">{{ _next_label }}</span>
175
- {% endif %}
173
+ {%- endif -%}
176
174
  </button>
177
- {% endif %}
175
+ {%- endif -%}
178
176
  </div>
179
-
180
- {% endapply %}
177
+ {#--#}
@@ -1,5 +1,5 @@
1
1
  {% extends '@oe-bcl/bcl-base-templates/content-type.html.twig' -%}
2
2
 
3
3
  {%- block content %}
4
- {% include '@oe-bcl/bcl-form/form.html.twig' with form only %}
4
+ {%- include '@oe-bcl/bcl-form/form.html.twig' with form only %}
5
5
  {%- endblock -%}