@openeuropa/bcl-project-status 0.21.0 → 0.23.1

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/package.json CHANGED
@@ -2,14 +2,15 @@
2
2
  "name": "@openeuropa/bcl-project-status",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.21.0",
5
+ "version": "0.23.1",
6
6
  "description": "OE - BCL project status",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
10
  "dependencies": {
11
- "@openeuropa/bcl-badge": "^0.21.0",
12
- "@openeuropa/bcl-progress": "^0.21.0"
11
+ "@openeuropa/bcl-badge": "^0.23.1",
12
+ "@openeuropa/bcl-heading": "^0.23.1",
13
+ "@openeuropa/bcl-progress": "^0.23.1"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -25,5 +26,5 @@
25
26
  "design-system",
26
27
  "twig"
27
28
  ],
28
- "gitHead": "18c01b34ca76780f480c692c566dfe507d961ccf"
29
+ "gitHead": "927e89290a185b5e578065e44e81cb99b0b47c12"
29
30
  }
@@ -0,0 +1,56 @@
1
+ {% spaceless %}
2
+
3
+ {# Parameters:
4
+ - corporate_contributions (string) (default: '') // value every 5 percent
5
+ - legend (boolean or object (default: false)
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(false) %}
15
+ {% set _chart = chart|default(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
+ {% endspaceless %}
@@ -1,9 +1,6 @@
1
1
  {% spaceless %}
2
2
 
3
3
  {# Parameters:
4
- - title_id (string) (default: "")
5
- - title (string) (default: "")
6
- - title_tag (string) (default: "h3")
7
4
  - status (string) (default: 'planned')
8
5
  - start_date (string) (default: '')
9
6
  - start_label (string) (default: '')
@@ -12,16 +9,9 @@
12
9
  - label (string) (default: '')
13
10
  - badge (string) (default: ''),
14
11
  - progress (string) (default: '')
15
- - corporate_contribution (string) (default: '') // value every 5 percent
16
- - chart_legend (object) (default: {})
17
-
18
- Blocks - chart
19
12
  #}
20
13
 
21
- {% set _title_id = title_id|default('') %}
22
- {% set _title = title|default('') %}
23
14
  {% set _label = label|default('') %}
24
- {% set _title_tag = title_tag|default('h3') %}
25
15
  {% set _status = status|default('planned') %}
26
16
  {% set _charts = charts|default('') %}
27
17
  {% set _badge = badge|default('') %}
@@ -30,8 +20,17 @@
30
20
  {% set _start_label = start_label|default('') %}
31
21
  {% set _end_label = end_label|default('') %}
32
22
  {% set _progress = progress|default('') %}
33
- {% set _corporate_contribution = corporate_contribution|default('') %}
34
- {% set _chart_legend = chart_legend|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
+ ]) %}
35
34
 
36
35
  {% set _bgs = {
37
36
  ongoing: 'info',
@@ -40,17 +39,7 @@
40
39
  } %}
41
40
  {% set _bg = _bgs[_status]|default('secondary') %}
42
41
 
43
-
44
- <{{ _title_tag }}
45
- class="fw-bold mb-4"
46
- {% if title_id is not empty %}
47
- id="{{ title_id }}"
48
- {% endif %}
49
- >
50
- {{- title -}}
51
- </{{ _title_tag }}>
52
-
53
- <div class="border-bottom pb-4 mb-4">
42
+ <div {{ attributes }}>
54
43
  <div class="row">
55
44
  <div class="col-12 col-md-3">
56
45
  {% if _label is not empty %}
@@ -103,26 +92,7 @@
103
92
  </div>
104
93
  </div>
105
94
  </div>
106
- {% if _corporate_contribution is not empty and _chart_legend is not empty %}
107
- <div class="border-bottom pb-4 mb-4">
108
- {% block chart %}
109
- <div class="row">
110
- <div class="col-5 col-md-3">
111
- <div class="circular-progress" data-percentage="{{ _corporate_contribution }}">
112
- <span class="circular-progress-left">
113
- <span class="circular-progress-bar"></span>
114
- </span>
115
- <span class="circular-progress-right">
116
- <span class="circular-progress-bar"></span>
117
- </span>
118
- </div>
119
- </div>
120
- <div class="col-7 col-md-9 align-self-center">
121
- {% include '@oe-bcl/bcl-description-list/description-list.html.twig' with _chart_legend only %}
122
- </div>
123
- </div>
124
- {% endblock %}
125
- </div>
126
- {% endif %}
95
+
96
+
127
97
 
128
98
  {% endspaceless %}