@openeuropa/bcl-project-status 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/package.json +30 -0
- package/project-contributions.html.twig +56 -0
- package/project-status.html.twig +99 -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.
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openeuropa/bcl-project-status",
|
|
3
|
+
"author": "European Commission",
|
|
4
|
+
"license": "EUPL-1.2",
|
|
5
|
+
"version": "0.1.202408021145",
|
|
6
|
+
"description": "OE - BCL project status",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@openeuropa/bcl-badge": "^0.1.202408021145",
|
|
12
|
+
"@openeuropa/bcl-heading": "^0.1.202408021145",
|
|
13
|
+
"@openeuropa/bcl-progress": "^0.1.202408021145"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/openeuropa/bootstrap-component-library.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/openeuropa/bootstrap-component-library.git/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/openeuropa/bootstrap-component-library",
|
|
23
|
+
"keywords": [
|
|
24
|
+
"openeuropa",
|
|
25
|
+
"bootstrap-component-library",
|
|
26
|
+
"design-system",
|
|
27
|
+
"twig"
|
|
28
|
+
],
|
|
29
|
+
"gitHead": "7ee2013f7f64a70ddfa35228a9a65967dd71eec3"
|
|
30
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{% apply spaceless %}
|
|
2
|
+
|
|
3
|
+
{# Parameters:
|
|
4
|
+
- corporate_contributions (string) (default: '') // value every 5 percent
|
|
5
|
+
- legend (description list object) (default: {})
|
|
6
|
+
- chart (boolean) (default: false)
|
|
7
|
+
|
|
8
|
+
Blocks -
|
|
9
|
+
project_status_contrib_chart
|
|
10
|
+
project_status_contrib_legend
|
|
11
|
+
#}
|
|
12
|
+
|
|
13
|
+
{% set _corporate_contributions = corporate_contributions|default('') %}
|
|
14
|
+
{% set _legend = legend|default({}) %}
|
|
15
|
+
{% set _chart = chart ?? false %}
|
|
16
|
+
|
|
17
|
+
{% if attributes is empty %}
|
|
18
|
+
{% set attributes = create_attribute() %}
|
|
19
|
+
{% endif %}
|
|
20
|
+
|
|
21
|
+
{% set attributes = attributes.addClass([
|
|
22
|
+
'bcl-project-contributions',
|
|
23
|
+
'border-bottom',
|
|
24
|
+
'pb-4',
|
|
25
|
+
'mb-4'
|
|
26
|
+
]) %}
|
|
27
|
+
|
|
28
|
+
<div {{ attributes }}>
|
|
29
|
+
<div class="row">
|
|
30
|
+
|
|
31
|
+
{% if _chart is not empty %}
|
|
32
|
+
<div class="bcl-project-contributions-chart col-5 col-md-3">
|
|
33
|
+
{% block project_status_contrib_chart %}
|
|
34
|
+
<div class="circular-progress" data-percentage="{{ _corporate_contributions }}">
|
|
35
|
+
<span class="circular-progress-left">
|
|
36
|
+
<span class="circular-progress-bar"></span>
|
|
37
|
+
</span>
|
|
38
|
+
<span class="circular-progress-right">
|
|
39
|
+
<span class="circular-progress-bar"></span>
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
{% endblock %}
|
|
43
|
+
</div>
|
|
44
|
+
{% endif %}
|
|
45
|
+
|
|
46
|
+
{% if _legend is not empty %}
|
|
47
|
+
<div class="bcl-project-contributions-legend col-7 col-md-9 align-self-center">
|
|
48
|
+
{% block project_status_contrib_legend %}
|
|
49
|
+
{% include '@oe-bcl/bcl-description-list/description-list.html.twig' with _legend only %}
|
|
50
|
+
{% endblock %}
|
|
51
|
+
</div>
|
|
52
|
+
{% endif %}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
{% endapply %}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{% apply spaceless %}
|
|
2
|
+
|
|
3
|
+
{# Parameters:
|
|
4
|
+
- label (string) (default: '')
|
|
5
|
+
- status (string) (default: 'planned')
|
|
6
|
+
- badge (string) (default: '')
|
|
7
|
+
- start_date (string) (default: '')
|
|
8
|
+
- start_label (string) (default: '')
|
|
9
|
+
- end_date (string) (default: '')
|
|
10
|
+
- end_label (string) (default: '')
|
|
11
|
+
- progress (string) (default: '')
|
|
12
|
+
- attributes (drupal attrs)
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
{% set _label = label|default('') %}
|
|
16
|
+
{% set _status = status|default('planned') %}
|
|
17
|
+
{% set _badge = badge|default('') %}
|
|
18
|
+
{% set _start_date = start_date|default('') %}
|
|
19
|
+
{% set _start_label = start_label|default('') %}
|
|
20
|
+
{% set _end_date = end_date|default('') %}
|
|
21
|
+
{% set _end_label = end_label|default('') %}
|
|
22
|
+
{% set _progress = progress|default('') %}
|
|
23
|
+
|
|
24
|
+
{% if attributes is empty %}
|
|
25
|
+
{% set attributes = create_attribute() %}
|
|
26
|
+
{% endif %}
|
|
27
|
+
|
|
28
|
+
{% set attributes = attributes.addClass([
|
|
29
|
+
'bcl-project-status',
|
|
30
|
+
'border-bottom',
|
|
31
|
+
'pb-4',
|
|
32
|
+
'mb-4'
|
|
33
|
+
]) %}
|
|
34
|
+
|
|
35
|
+
{% set _bgs = {
|
|
36
|
+
ongoing: 'info',
|
|
37
|
+
closed: 'dark',
|
|
38
|
+
planned: 'secondary',
|
|
39
|
+
} %}
|
|
40
|
+
{% set _bg = _bgs[_status]|default('secondary') %}
|
|
41
|
+
|
|
42
|
+
<div {{ attributes }}>
|
|
43
|
+
<div class="row">
|
|
44
|
+
<div class="col-12 col-md-3">
|
|
45
|
+
{% if _label is not empty %}
|
|
46
|
+
<p class="fw-bold">{{ _label }}</p>
|
|
47
|
+
{% endif %}
|
|
48
|
+
|
|
49
|
+
{% if _badge is not empty %}
|
|
50
|
+
{% include '@oe-bcl/bcl-badge/badge.html.twig' with {
|
|
51
|
+
label: _badge,
|
|
52
|
+
rounded_pill: true,
|
|
53
|
+
background: _bg,
|
|
54
|
+
attributes: create_attribute().addClass(['mb-3', 'mb-md-0']),
|
|
55
|
+
} only %}
|
|
56
|
+
{% endif %}
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="col-12 col-md-9">
|
|
61
|
+
<div class="d-flex justify-content-between">
|
|
62
|
+
|
|
63
|
+
{% if _start_date is not empty and _start_label is not empty %}
|
|
64
|
+
<p class="fw-bold">
|
|
65
|
+
{{- _start_label -}} <br>
|
|
66
|
+
<span class="fw-normal">
|
|
67
|
+
{{- _start_date -}}
|
|
68
|
+
</span>
|
|
69
|
+
</p>
|
|
70
|
+
{% endif %}
|
|
71
|
+
|
|
72
|
+
{% if _end_date is not empty and _end_label is not empty %}
|
|
73
|
+
<p class="fw-bold text-end">
|
|
74
|
+
{{- _end_label -}} <br>
|
|
75
|
+
<span class="fw-normal">
|
|
76
|
+
{{- _end_date -}}
|
|
77
|
+
</span>
|
|
78
|
+
</p>
|
|
79
|
+
{% endif %}
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
{% if _progress is not empty or _status != 'ongoing' %}
|
|
83
|
+
{% if _progress is empty %}
|
|
84
|
+
{% set _progress = _status == 'closed' ? 100 : 0 %}
|
|
85
|
+
{% endif %}
|
|
86
|
+
{% include '@oe-bcl/bcl-progress/progress.html.twig' with {
|
|
87
|
+
variant: _bg,
|
|
88
|
+
hidden_label: true,
|
|
89
|
+
progress: _progress,
|
|
90
|
+
} only %}
|
|
91
|
+
{% endif %}
|
|
92
|
+
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
{% endapply %}
|