@openeuropa/bcl-base-templates 0.1.202408021145
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/LICENSE.md +21 -0
- package/content-type.html.twig +139 -0
- package/data/content-page.js +27 -0
- package/data/layout.js +19 -0
- package/data/listing-page.js +7 -0
- package/listing-page.html.twig +74 -0
- package/package.json +36 -0
- package/sidebar-search.html.twig +20 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2021 Mark Otto
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{% apply spaceless %}
|
|
2
|
+
|
|
3
|
+
{#
|
|
4
|
+
Parameters:
|
|
5
|
+
- with_header (boolean) (default: false)
|
|
6
|
+
- with_footer (boolean) (default: false)
|
|
7
|
+
- with_banner (boolean) (default: false)
|
|
8
|
+
- with_sidebar (boolean) (default: false)
|
|
9
|
+
- sidebar_size (string) (default: 'normal')
|
|
10
|
+
options: ['normal', 'large']
|
|
11
|
+
- landing (boolean) (default: false)
|
|
12
|
+
- content_type (string) (default: '')
|
|
13
|
+
- attributes (drupal attrs)
|
|
14
|
+
|
|
15
|
+
BLOCKS:
|
|
16
|
+
- header
|
|
17
|
+
- footer
|
|
18
|
+
- content
|
|
19
|
+
- content_row
|
|
20
|
+
- sidebar
|
|
21
|
+
- banner
|
|
22
|
+
- feedback
|
|
23
|
+
- share
|
|
24
|
+
- related
|
|
25
|
+
- messages_area
|
|
26
|
+
#}
|
|
27
|
+
|
|
28
|
+
{% set _with_header = header ?? false %}
|
|
29
|
+
{% set _with_footer = footer ?? false %}
|
|
30
|
+
{% set _with_banner = banner ?? false %}
|
|
31
|
+
{% set _with_sidebar = sidebar ?? false %}
|
|
32
|
+
{% set _sidebar_size = sidebar_size|default('normal') %}
|
|
33
|
+
{% set _landing = landing ?? false %}
|
|
34
|
+
{% set _content_type = content_type|default('') %}
|
|
35
|
+
{% set _classes = ['bcl-node-type'] %}
|
|
36
|
+
|
|
37
|
+
{% if _with_sidebar %}
|
|
38
|
+
{% set _col_classes = {
|
|
39
|
+
left: [
|
|
40
|
+
'col-12',
|
|
41
|
+
'bcl-sidebar',
|
|
42
|
+
],
|
|
43
|
+
right: [
|
|
44
|
+
'col-12',
|
|
45
|
+
],
|
|
46
|
+
} %}
|
|
47
|
+
|
|
48
|
+
{% if _sidebar_size == 'normal' %}
|
|
49
|
+
{% set _col_classes = _col_classes|merge({
|
|
50
|
+
left: _col_classes.left|merge(['col-lg-3']),
|
|
51
|
+
right: _col_classes.right|merge(['col-lg-9', 'col-xxl-8']),
|
|
52
|
+
}) %}
|
|
53
|
+
{% endif %}
|
|
54
|
+
|
|
55
|
+
{% if _sidebar_size == 'large' %}
|
|
56
|
+
{% set _col_classes = _col_classes|merge({
|
|
57
|
+
left: _col_classes.left|merge(['col-lg-4']),
|
|
58
|
+
right: _col_classes.right|merge(['col-lg-8']),
|
|
59
|
+
}) %}
|
|
60
|
+
{% endif %}
|
|
61
|
+
{% endif %}
|
|
62
|
+
|
|
63
|
+
{% if _content_type is not empty %}
|
|
64
|
+
{% set _classes = _classes|merge(['bcl-' ~ _content_type]) %}
|
|
65
|
+
{% endif %}
|
|
66
|
+
|
|
67
|
+
{% if attributes is empty %}
|
|
68
|
+
{% set attributes = create_attribute() %}
|
|
69
|
+
{% endif %}
|
|
70
|
+
|
|
71
|
+
{% if _with_header %}
|
|
72
|
+
{% include '@oe-bcl/bcl-header/header.html.twig' with header only %}
|
|
73
|
+
{% endif %}
|
|
74
|
+
|
|
75
|
+
<main {{ attributes }}>
|
|
76
|
+
{% if messages is defined and messages is not empty %}
|
|
77
|
+
{% block messages_area %}
|
|
78
|
+
<div class="container">
|
|
79
|
+
{% for message in messages %}
|
|
80
|
+
{% set message_attributes = create_attribute().addClass(['mt-lg-5', 'mt-2']) %}
|
|
81
|
+
{% include '@oe-bcl/bcl-alert/alert.html.twig' with message|merge({
|
|
82
|
+
attributes: message_attributes,
|
|
83
|
+
}) only %}
|
|
84
|
+
{% endfor %}
|
|
85
|
+
</div>
|
|
86
|
+
{% endblock %}
|
|
87
|
+
{% endif %}
|
|
88
|
+
|
|
89
|
+
{% if _with_banner %}
|
|
90
|
+
{% block banner %}
|
|
91
|
+
{% include '@oe-bcl/bcl-content-banner/content-banner.html.twig' with banner only %}
|
|
92
|
+
{% endblock %}
|
|
93
|
+
{% endif %}
|
|
94
|
+
|
|
95
|
+
<div class="container mt-md-4-75 mt-4">
|
|
96
|
+
<div class="row">
|
|
97
|
+
{% block content_row %}
|
|
98
|
+
{{ content_row }}
|
|
99
|
+
{% endblock %}
|
|
100
|
+
{% if _with_sidebar %}
|
|
101
|
+
<div class="{{ _col_classes.left|join(' ') }}">
|
|
102
|
+
{% block sidebar %}{% endblock %}
|
|
103
|
+
</div>
|
|
104
|
+
<div class="{{ _col_classes.right|join(' ') }}">
|
|
105
|
+
{% else %}
|
|
106
|
+
{% if _landing %}
|
|
107
|
+
<div class="col-12">
|
|
108
|
+
{% else %}
|
|
109
|
+
<div class="col-lg-10 col-xl-9 col-xxl-8">
|
|
110
|
+
{% endif %}
|
|
111
|
+
{% endif %}
|
|
112
|
+
{% block content_top %}
|
|
113
|
+
{{ content_top }}
|
|
114
|
+
{% endblock %}
|
|
115
|
+
{% block content %}
|
|
116
|
+
{{ content }}
|
|
117
|
+
{% endblock %}
|
|
118
|
+
{% block content_bottom %}
|
|
119
|
+
{{ content_bottom }}
|
|
120
|
+
{% endblock %}
|
|
121
|
+
{% block related %}
|
|
122
|
+
{{ related }}
|
|
123
|
+
{% endblock %}
|
|
124
|
+
{% block share %}
|
|
125
|
+
{{ share }}
|
|
126
|
+
{% endblock %}
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</main>
|
|
130
|
+
|
|
131
|
+
{% block feedback %}
|
|
132
|
+
{{ feedback }}
|
|
133
|
+
{% endblock %}
|
|
134
|
+
|
|
135
|
+
{% if _with_footer %}
|
|
136
|
+
{% include '@oe-bcl/bcl-footer/footer.html.twig' with footer only %}
|
|
137
|
+
{% endif %}
|
|
138
|
+
|
|
139
|
+
{% endapply %}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import banner from "@openeuropa/bcl-content-banner/data/data";
|
|
2
|
+
import pageBanner from "@openeuropa/bcl-banner/data/data--image";
|
|
3
|
+
import simpleBanner from "@openeuropa/bcl-content-banner/data/data--simple";
|
|
4
|
+
import pageTitleBanner from "@openeuropa/bcl-content-banner/data/data--page-title";
|
|
5
|
+
import fileThumbnail from "@openeuropa/bcl-file/data/data--card";
|
|
6
|
+
import file from "@openeuropa/bcl-file/data/data";
|
|
7
|
+
import blockquote from "@openeuropa/bcl-data-blockquote/data";
|
|
8
|
+
import featuredItem from "@openeuropa/bcl-featured-media/data/data--featured-item";
|
|
9
|
+
import accordion from "@openeuropa/bcl-data-accordion/data";
|
|
10
|
+
import timeline from "@openeuropa/bcl-timeline/data";
|
|
11
|
+
import sidebar from "@openeuropa/bcl-inpage-navigation/data/data--simple";
|
|
12
|
+
import share from "@openeuropa/bcl-links-block/data/data--share";
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
banner,
|
|
16
|
+
fileThumbnail,
|
|
17
|
+
file,
|
|
18
|
+
blockquote,
|
|
19
|
+
featuredItem,
|
|
20
|
+
accordion,
|
|
21
|
+
timeline,
|
|
22
|
+
pageBanner,
|
|
23
|
+
simpleBanner,
|
|
24
|
+
sidebar,
|
|
25
|
+
pageTitleBanner,
|
|
26
|
+
share,
|
|
27
|
+
};
|
package/data/layout.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import headerSimple from "@openeuropa/bcl-data-header/data--simple";
|
|
2
|
+
import headerNoForm from "@openeuropa/bcl-data-header/data--no-form";
|
|
3
|
+
import footerData from "@openeuropa/bcl-data-footer/data";
|
|
4
|
+
import header_ucpkn from "@openeuropa/bcl-data-header/data--ucpkn";
|
|
5
|
+
import header_joinup from "@openeuropa/bcl-data-header/data--neutral";
|
|
6
|
+
import drupalAttribute from "drupal-attribute";
|
|
7
|
+
|
|
8
|
+
const footer = {
|
|
9
|
+
...footerData,
|
|
10
|
+
attributes: new drupalAttribute().addClass(["mt-md-4-75", "mt-4"]),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
headerSimple,
|
|
15
|
+
headerNoForm,
|
|
16
|
+
footer,
|
|
17
|
+
header_ucpkn,
|
|
18
|
+
header_joinup,
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import filterButton from "@openeuropa/bcl-data-button/data--filter";
|
|
2
|
+
import pagination from "@openeuropa/bcl-data-pagination/data--listing";
|
|
3
|
+
import sortSelect from "@openeuropa/bcl-data-select/data--sort";
|
|
4
|
+
import listingDate from "@openeuropa/bcl-listing/data/listing--date";
|
|
5
|
+
import listingProfiles from "@openeuropa/bcl-listing/data/listing--profiles";
|
|
6
|
+
|
|
7
|
+
export { filterButton, pagination, sortSelect, listingDate, listingProfiles };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{#
|
|
2
|
+
Parameters:
|
|
3
|
+
- title: (string) (default: '')
|
|
4
|
+
- title_tag: (string) (default: 'h2')
|
|
5
|
+
- title_link: (link object) (default: {})
|
|
6
|
+
- title_attributes (drupal attrs)
|
|
7
|
+
- listing (object) (default: {})
|
|
8
|
+
- pagination (object) (default: {})
|
|
9
|
+
- sidebar (object) (default: '')
|
|
10
|
+
#}
|
|
11
|
+
|
|
12
|
+
{% extends "@oe-bcl/bcl-base-templates/content-type.html.twig" %}
|
|
13
|
+
|
|
14
|
+
{% set _title = title|default('') %}
|
|
15
|
+
{% set _title_tag = title_tag|default('h2') %}
|
|
16
|
+
{% set _title_link = title_link|default({}) %}
|
|
17
|
+
{% set _title_attributes = title_attributes ?: create_attribute() %}
|
|
18
|
+
{% set _listing = listing|default({}) %}
|
|
19
|
+
{% set _pagination = pagination|default({}) %}
|
|
20
|
+
{% set _sidebar = sidebar|default({}) %}
|
|
21
|
+
|
|
22
|
+
{% set _title_attributes = _title_attributes ?: create_attribute() %}
|
|
23
|
+
|
|
24
|
+
{% block content_top %}
|
|
25
|
+
{% if filter_button %}
|
|
26
|
+
{% include '@oe-bcl/bcl-button/button.html.twig' with filter_button only %}
|
|
27
|
+
{% endif %}
|
|
28
|
+
<div class="row">
|
|
29
|
+
<div class="col-md-6 col-lg-8 align-self-center">
|
|
30
|
+
{% if _title is not empty %}
|
|
31
|
+
{% include '@oe-bcl/bcl-heading/heading.html.twig' with {
|
|
32
|
+
title: _title ~ ' (' ~ listing.items.length ~ ')',
|
|
33
|
+
title_tag: _title_tag,
|
|
34
|
+
title_link: _title_link,
|
|
35
|
+
attributes: _title_attributes.addClass(['mb-0', 'text-capitalize']),
|
|
36
|
+
} only %}
|
|
37
|
+
{% endif %}
|
|
38
|
+
</div>
|
|
39
|
+
{% if badges is not empty and badges is iterable %}
|
|
40
|
+
<div class="col-md-12 order-md-2 mt-3">
|
|
41
|
+
{% for badge in badges %}
|
|
42
|
+
{% include '@oe-bcl/bcl-badge/badge.html.twig' with badge|merge({
|
|
43
|
+
attributes: create_attribute().addClass(["mb-2", "me-2"])
|
|
44
|
+
}) only %}
|
|
45
|
+
{% endfor %}
|
|
46
|
+
</div>
|
|
47
|
+
{% endif %}
|
|
48
|
+
<div class="col-md-6 col-lg-4 mt-3 mt-md-0">
|
|
49
|
+
<div class="float-md-end d-md-flex align-items-center mb-4 mb-md-0">
|
|
50
|
+
{% include '@oe-bcl/bcl-select/select.html.twig' with sort_select|merge({
|
|
51
|
+
attributes: create_attribute().addClass(['ms-md-2']),
|
|
52
|
+
}) only %}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<hr class="d-none d-md-block mb-4-75"/>
|
|
57
|
+
{% endblock %}
|
|
58
|
+
|
|
59
|
+
{% block content %}
|
|
60
|
+
{% if _listing is not empty %}
|
|
61
|
+
{% include '@oe-bcl/bcl-listing/listing.html.twig' with _listing only %}
|
|
62
|
+
{% endif %}
|
|
63
|
+
{% endblock %}
|
|
64
|
+
|
|
65
|
+
{% block content_bottom %}
|
|
66
|
+
{% if _pagination is not empty %}
|
|
67
|
+
<hr class="d-none d-md-block mt-4-5">
|
|
68
|
+
{% include '@oe-bcl/bcl-pagination/pagination.html.twig' with _pagination only %}
|
|
69
|
+
{% endif %}
|
|
70
|
+
{% endblock %}
|
|
71
|
+
|
|
72
|
+
{% block sidebar %}
|
|
73
|
+
{% include '@oe-bcl/bcl-base-templates/sidebar-search.html.twig' with _sidebar only %}
|
|
74
|
+
{% endblock %}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openeuropa/bcl-base-templates",
|
|
3
|
+
"author": "European Commission",
|
|
4
|
+
"license": "EUPL-1.2",
|
|
5
|
+
"version": "0.1.202408021145",
|
|
6
|
+
"description": "OE - BCL base templates",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@openeuropa/bcl-badge": "^0.1.202408021145",
|
|
12
|
+
"@openeuropa/bcl-button": "^0.1.202408021145",
|
|
13
|
+
"@openeuropa/bcl-content-banner": "^0.1.202408021145",
|
|
14
|
+
"@openeuropa/bcl-footer": "^0.1.202408021145",
|
|
15
|
+
"@openeuropa/bcl-header": "^0.1.202408021145",
|
|
16
|
+
"@openeuropa/bcl-listing": "^0.1.202408021145",
|
|
17
|
+
"@openeuropa/bcl-offcanvas": "^0.1.202408021145",
|
|
18
|
+
"@openeuropa/bcl-pagination": "^0.1.202408021145",
|
|
19
|
+
"@openeuropa/bcl-select": "^0.1.202408021145"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/openeuropa/bootstrap-component-library.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/openeuropa/bootstrap-component-library.git/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/openeuropa/bootstrap-component-library",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"openeuropa",
|
|
31
|
+
"bootstrap-component-library",
|
|
32
|
+
"design-system",
|
|
33
|
+
"twig"
|
|
34
|
+
],
|
|
35
|
+
"gitHead": "7ee2013f7f64a70ddfa35228a9a65967dd71eec3"
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% extends "@oe-bcl/bcl-offcanvas/offcanvas.html.twig" %}
|
|
2
|
+
|
|
3
|
+
{% set responsiveness = 'lg' %}
|
|
4
|
+
{% if extra_classes_header is empty %}
|
|
5
|
+
{% set extra_classes_header = 'd-lg-block' %}
|
|
6
|
+
{% else %}
|
|
7
|
+
{% set extra_classes_header = extra_classes_header ~ ' d-lg-block' %}
|
|
8
|
+
{% endif %}
|
|
9
|
+
|
|
10
|
+
{% block body %}
|
|
11
|
+
{% if search_form.attributes is empty %}
|
|
12
|
+
{% set attributes = search_form.create_attribute() %}
|
|
13
|
+
{% endif %}
|
|
14
|
+
|
|
15
|
+
<div class="offcanvas-body p-lg-0">
|
|
16
|
+
{% include '@oe-bcl/bcl-form/form.html.twig' with search_form|merge({
|
|
17
|
+
attributes: search_form.attributes.addClass('w-100')
|
|
18
|
+
}) only %}
|
|
19
|
+
</div>
|
|
20
|
+
{% endblock %}
|