@openeuropa/bcl-base-templates 0.15.0 → 0.19.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.
@@ -6,7 +6,9 @@
6
6
  - with_footer (boolean) (default: false)
7
7
  - with_banner (boolean) (default: false)
8
8
  - with_sidebar (boolean) (default: false)
9
- - columns (string) (default: 3-9 )
9
+ - sidebar_size (string) (default: 'normal')
10
+ options: ['normal', 'large']
11
+ - landing (boolean) (default: false)
10
12
  - content_type (string) (default: '')
11
13
  - attributes (drupal attrs)
12
14
 
@@ -19,32 +21,69 @@
19
21
  - feedback
20
22
  - share
21
23
  - related
24
+ - messages_area
22
25
  #}
23
26
 
24
27
  {% set _with_header = header|default(false) %}
25
28
  {% set _with_footer = footer|default(false) %}
26
29
  {% set _with_banner = banner|default(false) %}
27
30
  {% set _with_sidebar = sidebar|default(false) %}
28
- {% set _columns = columns|default('3-9') %}
31
+ {% set _sidebar_size = sidebar_size|default('normal') %}
32
+ {% set _landing = landing|default(false) %}
29
33
  {% set _content_type = content_type|default('') %}
30
34
  {% set _classes = ['bcl-node-type'] %}
31
- {% set _col_classes = { left: 'col-md-3', right: 'col-12 col-md-9' } %}
32
35
 
33
- {% if _columns == '4-8' %}
34
- {% set _col_classes = { left: 'col-md-4', right: 'col-12 col-md-8' } %}
35
- {% elseif _columns == '2-10' %}
36
- {% set _col_classes = { left: 'col-md-2', right: 'col-12 col-md-10' } %}
36
+ {% if _with_sidebar %}
37
+ {% set _col_classes = {
38
+ left: [
39
+ 'col-12',
40
+ ],
41
+ right: [
42
+ 'col-12',
43
+ ],
44
+ } %}
45
+
46
+ {% if _sidebar_size == 'normal' %}
47
+ {% set _col_classes = _col_classes|merge({
48
+ left: _col_classes.left|merge(['col-lg-3']),
49
+ right: _col_classes.right|merge(['col-lg-9', 'col-xxl-8']),
50
+ }) %}
51
+ {% endif %}
52
+
53
+ {% if _sidebar_size == 'large' %}
54
+ {% set _col_classes = _col_classes|merge({
55
+ left: _col_classes.left|merge(['col-lg-4']),
56
+ right: _col_classes.right|merge(['col-lg-8']),
57
+ }) %}
58
+ {% endif %}
37
59
  {% endif %}
38
60
 
39
61
  {% if _content_type is not empty %}
40
62
  {% set _classes = _classes|merge(['bcl-' ~ _content_type]) %}
41
63
  {% endif %}
42
64
 
65
+ {% if attributes is empty %}
66
+ {% set attributes = create_attribute() %}
67
+ {% endif %}
68
+
43
69
  {% if _with_header %}
44
70
  {% include '@oe-bcl/bcl-header/header.html.twig' with header only %}
45
71
  {% endif %}
46
72
 
47
73
  <main {{ attributes }}>
74
+ {% if messages is defined and messages is not empty %}
75
+ {% block messages_area %}
76
+ <div class="container">
77
+ {% for message in messages %}
78
+ {% set message_attributes = create_attribute().addClass(['mt-lg-5', 'mt-2']) %}
79
+ {% include '@oe-bcl/bcl-alert/alert.html.twig' with message|merge({
80
+ attributes: message_attributes,
81
+ }) only %}
82
+ {% endfor %}
83
+ </div>
84
+ {% endblock %}
85
+ {% endif %}
86
+
48
87
  {% if _with_banner %}
49
88
  {% block banner %}
50
89
  {% include '@oe-bcl/bcl-content-banner/content-banner.html.twig' with banner only %}
@@ -54,12 +93,16 @@
54
93
  <div class="container mt-md-4-75 mt-4">
55
94
  <div class="row">
56
95
  {% if _with_sidebar %}
57
- <div class="{{ _col_classes.left }}">
96
+ <div class="{{ _col_classes.left|join(' ') }}">
58
97
  {% block sidebar %}{% endblock %}
59
98
  </div>
60
- <div class="{{ _col_classes.right }}">
99
+ <div class="{{ _col_classes.right|join(' ') }}">
61
100
  {% else %}
62
- <div class="col-md-12">
101
+ {% if _landing %}
102
+ <div class="col-12">
103
+ {% else %}
104
+ <div class="col-12 col-lg-10 col-xl-9 col-xxl-8">
105
+ {% endif %}
63
106
  {% endif %}
64
107
  {% block content_top %}
65
108
  {{ content_top }}
@@ -16,30 +16,33 @@
16
16
 
17
17
  {% block content_top %}
18
18
  {% include '@oe-bcl/bcl-button/button.html.twig' with filter_button only %}
19
- <div class="mb-3 clearfix">
20
- <div class="float-end d-none d-md-flex align-items-center">
21
- {% include '@oe-bcl/bcl-select/select.html.twig' with sort_select|merge({
22
- attributes: create_attribute().addClass(['ms-2 mb-2']),
23
- }) only %}
19
+ <div class="row">
20
+ <div class="col-md-6 col-lg-8">
21
+ <h4>
22
+ <span class="text-capitalize">
23
+ {{- _page_title -}}
24
+ </span>
25
+ ({{ listing.items.length }})
26
+ </h4>
27
+ </div>
28
+ <div class="col-md-12 order-md-2 mt-3 mt-md-1">
29
+ {% if badges is not empty and badges is iterable %}
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
+ {% endif %}
36
+ </div>
37
+ <div class="col-md-6 col-lg-4 mt-3 mt-md-0">
38
+ <div class="float-md-end d-md-flex align-items-center mb-4 mb-md-0">
39
+ {% include '@oe-bcl/bcl-select/select.html.twig' with sort_select|merge({
40
+ attributes: create_attribute().addClass(['ms-md-2 mb-2']),
41
+ }) only %}
42
+ </div>
24
43
  </div>
25
- <h4 class="mb-4">
26
- <span class="text-capitalize">
27
- {{- _page_title -}}
28
- </span>
29
- ({{ listing.items.length }})
30
- </h4>
31
- {% if badges is not empty and badges is iterable %}
32
- {% for badge in badges %}
33
- {% include '@oe-bcl/bcl-badge/badge.html.twig' with badge only %}
34
- {% endfor %}
35
- {% endif %}
36
44
  </div>
37
45
  <hr class="d-none d-md-block mb-4"/>
38
- <div class="d-md-none">
39
- {% include '@oe-bcl/bcl-select/select.html.twig' with sort_select|merge({
40
- extra_classes: 'mb-4',
41
- }) only %}
42
- </div>
43
46
  {% endblock %}
44
47
 
45
48
  {% block content %}
package/package.json CHANGED
@@ -2,21 +2,21 @@
2
2
  "name": "@openeuropa/bcl-base-templates",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.15.0",
5
+ "version": "0.19.0",
6
6
  "description": "OE - BCL base templates",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
10
  "dependencies": {
11
- "@openeuropa/bcl-badge": "^0.15.0",
12
- "@openeuropa/bcl-button": "^0.15.0",
13
- "@openeuropa/bcl-content-banner": "^0.15.0",
14
- "@openeuropa/bcl-footer": "^0.15.0",
15
- "@openeuropa/bcl-header": "^0.15.0",
16
- "@openeuropa/bcl-listing": "^0.15.0",
17
- "@openeuropa/bcl-offcanvas": "^0.15.0",
18
- "@openeuropa/bcl-pagination": "^0.15.0",
19
- "@openeuropa/bcl-select": "^0.15.0"
11
+ "@openeuropa/bcl-badge": "^0.19.0",
12
+ "@openeuropa/bcl-button": "^0.19.0",
13
+ "@openeuropa/bcl-content-banner": "^0.19.0",
14
+ "@openeuropa/bcl-footer": "^0.19.0",
15
+ "@openeuropa/bcl-header": "^0.19.0",
16
+ "@openeuropa/bcl-listing": "^0.19.0",
17
+ "@openeuropa/bcl-offcanvas": "^0.19.0",
18
+ "@openeuropa/bcl-pagination": "^0.19.0",
19
+ "@openeuropa/bcl-select": "^0.19.0"
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
@@ -32,5 +32,5 @@
32
32
  "design-system",
33
33
  "twig"
34
34
  ],
35
- "gitHead": "97a9f0822ee0d4d800e40aa17bf87dc698c5906c"
35
+ "gitHead": "8bfce06400c8829a46578797f0126b4e9c02e725"
36
36
  }