design-comuni-plone-theme 10.2.2 → 10.4.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.
- package/CHANGELOG.md +47 -0
- package/RELEASE.md +19 -0
- package/locales/de/LC_MESSAGES/volto.po +27 -30
- package/locales/en/LC_MESSAGES/volto.po +27 -30
- package/locales/es/LC_MESSAGES/volto.po +27 -30
- package/locales/fr/LC_MESSAGES/volto.po +27 -30
- package/locales/it/LC_MESSAGES/volto.po +27 -30
- package/locales/volto.pot +28 -31
- package/package.json +1 -1
- package/publiccode.yml +2 -2
- package/src/components/ItaliaTheme/Blocks/Alert/Edit.jsx +9 -5
- package/src/components/ItaliaTheme/Blocks/Alert/Sidebar.jsx +51 -76
- package/src/components/ItaliaTheme/Blocks/Alert/View.jsx +4 -2
- package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +5 -20
- package/src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx +1 -0
- package/src/components/ItaliaTheme/Blocks/__tests__/Alert.test.jsx +1 -1
- package/src/components/ItaliaTheme/GalleryPreview/GalleryPreview.jsx +11 -24
- package/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx +2 -1
- package/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx +42 -20
- package/src/components/ItaliaTheme/View/BandoView/BandoText.jsx +7 -37
- package/src/components/ItaliaTheme/View/BandoView/BandoTextDestinatari.jsx +36 -0
- package/src/components/ItaliaTheme/View/BandoView/BandoTextEnte.jsx +34 -0
- package/src/components/ItaliaTheme/View/BandoView/BandoTextTipologia.jsx +32 -0
- package/src/components/ItaliaTheme/View/Commons/BandoStatus.jsx +38 -0
- package/src/components/ItaliaTheme/View/Commons/PageHeader/PageHeaderBando.jsx +3 -17
- package/src/components/ItaliaTheme/View/Commons/SearchSectionForm.jsx +24 -3
- package/src/components/ItaliaTheme/View/VenueView/VenueDescription.jsx +9 -65
- package/src/components/ItaliaTheme/View/VenueView/VenueElementiDiInteresse.jsx +26 -0
- package/src/components/ItaliaTheme/View/VenueView/VenueLuoghiCorrelati.jsx +37 -0
- package/src/components/ItaliaTheme/View/VenueView/VenueMultimedia.jsx +25 -0
- package/src/components/ItaliaTheme/View/VenueView/VenueTipologia.jsx +27 -0
- package/src/components/ItaliaTheme/View/index.js +5 -0
- package/src/components/ItaliaTheme/manage/Widgets/IconPreviewWidget.jsx +1 -1
- package/src/theme/ItaliaTheme/Blocks/_alert.scss +26 -65
- package/src/theme/ItaliaTheme/Components/_galleryPreview.scss +9 -13
- package/src/theme/ItaliaTheme/Subsites/_common.scss +0 -1
- package/src/theme/ItaliaTheme/Views/_common.scss +10 -0
- package/src/theme/ItaliaTheme/_home.scss +10 -0
- package/src/theme/_cms-ui.scss +14 -0
- package/src/theme/_site-variables.scss +5 -0
- package/src/theme/ItaliaTheme/Subsites/_homepage.scss +0 -9
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
import { Button, Grid, Segment } from 'semantic-ui-react';
|
|
3
|
+
import { Segment } from 'semantic-ui-react';
|
|
5
4
|
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
|
|
6
5
|
import { FileWidget } from '@plone/volto/components';
|
|
6
|
+
import { ColorListWidget } from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
7
|
+
import ImageSizeWidget from '@plone/volto/components/manage/Widgets/ImageSizeWidget';
|
|
7
8
|
|
|
8
9
|
const messages = defineMessages({
|
|
9
10
|
Color: {
|
|
10
11
|
id: 'Color',
|
|
11
12
|
defaultMessage: 'Colore',
|
|
12
13
|
},
|
|
13
|
-
|
|
14
|
-
id: '
|
|
14
|
+
color_warning: {
|
|
15
|
+
id: 'color_warning',
|
|
15
16
|
defaultMessage: 'Giallo',
|
|
16
17
|
},
|
|
17
|
-
|
|
18
|
-
id: '
|
|
18
|
+
color_orange: {
|
|
19
|
+
id: 'color_orange',
|
|
19
20
|
defaultMessage: 'Arancione',
|
|
20
21
|
},
|
|
21
|
-
|
|
22
|
-
id: '
|
|
22
|
+
color_danger: {
|
|
23
|
+
id: 'color_danger',
|
|
23
24
|
defaultMessage: 'Rosso',
|
|
24
25
|
},
|
|
25
26
|
Image: {
|
|
26
27
|
id: 'Image',
|
|
27
28
|
defaultMessage: 'Immagine',
|
|
28
29
|
},
|
|
30
|
+
CardImageSize: {
|
|
31
|
+
id: 'CardImageSize',
|
|
32
|
+
defaultMessage: 'Dimensione immagine',
|
|
33
|
+
},
|
|
29
34
|
});
|
|
30
35
|
|
|
31
36
|
class Sidebar extends Component {
|
|
@@ -37,6 +42,21 @@ class Sidebar extends Component {
|
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
render() {
|
|
45
|
+
const bg_colors = [
|
|
46
|
+
{
|
|
47
|
+
name: 'info',
|
|
48
|
+
label: this.props.intl.formatMessage(messages.color_warning),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'warning',
|
|
52
|
+
label: this.props.intl.formatMessage(messages.color_orange),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'danger',
|
|
56
|
+
label: this.props.intl.formatMessage(messages.color_danger),
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
40
60
|
return (
|
|
41
61
|
<Segment.Group raised>
|
|
42
62
|
<header className="header pulled">
|
|
@@ -46,74 +66,18 @@ class Sidebar extends Component {
|
|
|
46
66
|
</header>
|
|
47
67
|
|
|
48
68
|
<Segment className="form">
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
verticalAlign="middle"
|
|
62
|
-
className="color-chooser"
|
|
63
|
-
>
|
|
64
|
-
<Button.Group vertical compact>
|
|
65
|
-
<Button
|
|
66
|
-
icon
|
|
67
|
-
basic={this.props.data.color !== 'warning'}
|
|
68
|
-
color="yellow"
|
|
69
|
-
onClick={(name, value) => {
|
|
70
|
-
this.props.onChangeBlock(this.props.block, {
|
|
71
|
-
...this.props.data,
|
|
72
|
-
color: 'warning',
|
|
73
|
-
});
|
|
74
|
-
}}
|
|
75
|
-
active={this.props.data.color === 'warning'}
|
|
76
|
-
content={this.props.intl.formatMessage(
|
|
77
|
-
messages.Color_warning,
|
|
78
|
-
)}
|
|
79
|
-
/>
|
|
80
|
-
|
|
81
|
-
<Button
|
|
82
|
-
icon
|
|
83
|
-
basic={this.props.data.color !== 'warning-orange'}
|
|
84
|
-
color="orange"
|
|
85
|
-
onClick={(name, value) => {
|
|
86
|
-
this.props.onChangeBlock(this.props.block, {
|
|
87
|
-
...this.props.data,
|
|
88
|
-
color: 'warning-orange',
|
|
89
|
-
});
|
|
90
|
-
}}
|
|
91
|
-
active={this.props.data.color === 'warning-orange'}
|
|
92
|
-
content={this.props.intl.formatMessage(
|
|
93
|
-
messages.Color_warning_orange,
|
|
94
|
-
)}
|
|
95
|
-
/>
|
|
96
|
-
|
|
97
|
-
<Button
|
|
98
|
-
icon
|
|
99
|
-
basic={this.props.data.color !== 'danger'}
|
|
100
|
-
color="red"
|
|
101
|
-
onClick={(name, value) => {
|
|
102
|
-
this.props.onChangeBlock(this.props.block, {
|
|
103
|
-
...this.props.data,
|
|
104
|
-
color: 'danger',
|
|
105
|
-
});
|
|
106
|
-
}}
|
|
107
|
-
active={this.props.data.color === 'danger'}
|
|
108
|
-
content={this.props.intl.formatMessage(
|
|
109
|
-
messages.Color_danger,
|
|
110
|
-
)}
|
|
111
|
-
/>
|
|
112
|
-
</Button.Group>
|
|
113
|
-
</Grid.Column>
|
|
114
|
-
</Grid.Row>
|
|
115
|
-
</Grid>
|
|
116
|
-
</Form.Field>
|
|
69
|
+
<ColorListWidget
|
|
70
|
+
id="bg_color"
|
|
71
|
+
title={this.props.intl.formatMessage(messages.Color)}
|
|
72
|
+
value={this.props.data.bg_color}
|
|
73
|
+
onChange={(id, value) => {
|
|
74
|
+
this.props.onChangeBlock(this.props.block, {
|
|
75
|
+
...this.props.data,
|
|
76
|
+
[id]: value,
|
|
77
|
+
});
|
|
78
|
+
}}
|
|
79
|
+
colors={bg_colors}
|
|
80
|
+
/>
|
|
117
81
|
<FileWidget
|
|
118
82
|
id="image"
|
|
119
83
|
title={this.props.intl.formatMessage(messages.Image)}
|
|
@@ -125,6 +89,17 @@ class Sidebar extends Component {
|
|
|
125
89
|
});
|
|
126
90
|
}}
|
|
127
91
|
/>
|
|
92
|
+
<ImageSizeWidget
|
|
93
|
+
id="sizeImage"
|
|
94
|
+
title={this.props.intl.formatMessage(messages.CardImageSize)}
|
|
95
|
+
onChange={(name, value) => {
|
|
96
|
+
this.props.onChangeBlock(this.props.block, {
|
|
97
|
+
...this.props.data,
|
|
98
|
+
sizeImage: value,
|
|
99
|
+
});
|
|
100
|
+
}}
|
|
101
|
+
value={this.props.data.sizeImage}
|
|
102
|
+
/>
|
|
128
103
|
</Segment>
|
|
129
104
|
</Segment.Group>
|
|
130
105
|
);
|
|
@@ -29,7 +29,7 @@ const View = ({ data, pathname }) => {
|
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<section role="alert" className="block alertblock">
|
|
32
|
-
<div className={cx('full-width', 'bg-alert-' + data.
|
|
32
|
+
<div className={cx('full-width', 'bg-alert-' + data.bg_color)}>
|
|
33
33
|
<Container className="p-4 pt-5 pb-5">
|
|
34
34
|
<Row className="align-items-start">
|
|
35
35
|
{data.image?.data && (
|
|
@@ -38,7 +38,9 @@ const View = ({ data, pathname }) => {
|
|
|
38
38
|
src={`data:${data.image['content-type']};${data.image.encoding},${data.image.data}`}
|
|
39
39
|
alt=""
|
|
40
40
|
aria-hidden="true"
|
|
41
|
-
className=
|
|
41
|
+
className={cx('left-image', [
|
|
42
|
+
data.sizeImage ? 'size-' + data.sizeImage : 'size-l',
|
|
43
|
+
])}
|
|
42
44
|
loading="lazy"
|
|
43
45
|
/>
|
|
44
46
|
</Col>
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
} from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
20
20
|
import { viewDate } from 'design-comuni-plone-theme/helpers';
|
|
21
21
|
|
|
22
|
+
import { BandoStatus } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
|
|
23
|
+
|
|
22
24
|
const messages = defineMessages({
|
|
23
25
|
vedi: {
|
|
24
26
|
id: 'bando_vedi',
|
|
@@ -40,22 +42,6 @@ const messages = defineMessages({
|
|
|
40
42
|
id: 'bando_stato',
|
|
41
43
|
defaultMessage: 'Stato:',
|
|
42
44
|
},
|
|
43
|
-
open: {
|
|
44
|
-
id: 'bando_open',
|
|
45
|
-
defaultMessage: 'Attivo',
|
|
46
|
-
},
|
|
47
|
-
scheduled: {
|
|
48
|
-
id: 'bando_scheduled',
|
|
49
|
-
defaultMessage: 'Programmato',
|
|
50
|
-
},
|
|
51
|
-
closed: {
|
|
52
|
-
id: 'bando_closed',
|
|
53
|
-
defaultMessage: 'Scaduto',
|
|
54
|
-
},
|
|
55
|
-
inProgress: {
|
|
56
|
-
id: 'bando_inProgress',
|
|
57
|
-
defaultMessage: 'In corso',
|
|
58
|
-
},
|
|
59
45
|
ente: {
|
|
60
46
|
id: 'bando_ente',
|
|
61
47
|
defaultMessage: 'Ente',
|
|
@@ -137,14 +123,13 @@ const BandiInEvidenceTemplate = ({
|
|
|
137
123
|
)}
|
|
138
124
|
|
|
139
125
|
{/* Tipologia */}
|
|
140
|
-
|
|
141
|
-
{show_tipologia && item.tipologia_bando?.title?.length > 0 && (
|
|
126
|
+
{show_tipologia && item?.tipologia_bando && (
|
|
142
127
|
<span className="d-flex flex-wrap align-items-baseline bando-dati-info">
|
|
143
128
|
<div className="bando-dati-label me-2">
|
|
144
129
|
{intl.formatMessage(messages.tipologia)}:
|
|
145
130
|
</div>
|
|
146
131
|
<span className="bando-dati-date">
|
|
147
|
-
{item.tipologia_bando
|
|
132
|
+
{item.tipologia_bando}
|
|
148
133
|
</span>
|
|
149
134
|
</span>
|
|
150
135
|
)}
|
|
@@ -215,7 +200,7 @@ const BandiInEvidenceTemplate = ({
|
|
|
215
200
|
),
|
|
216
201
|
})}
|
|
217
202
|
>
|
|
218
|
-
{
|
|
203
|
+
<BandoStatus content={item} />
|
|
219
204
|
</div>
|
|
220
205
|
</span>
|
|
221
206
|
</span>
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { defineMessages, useIntl } from 'react-intl';
|
|
3
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
4
|
-
|
|
5
3
|
import PropTypes from 'prop-types';
|
|
6
4
|
import { Modal, ModalBody, Button, ModalHeader } from 'design-react-kit';
|
|
7
5
|
import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
8
|
-
import
|
|
6
|
+
import Image from '@plone/volto/components/theme/Image/Image';
|
|
9
7
|
|
|
10
8
|
const messages = defineMessages({
|
|
11
9
|
view_prev: {
|
|
@@ -31,18 +29,10 @@ const messages = defineMessages({
|
|
|
31
29
|
*/
|
|
32
30
|
const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
|
|
33
31
|
const intl = useIntl();
|
|
32
|
+
|
|
34
33
|
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
35
34
|
const image = items[viewIndex];
|
|
36
35
|
|
|
37
|
-
let checkUrlImage = image?.image_field
|
|
38
|
-
? image?.image_scales?.[image?.image_field]?.[0]?.scales?.larger?.download
|
|
39
|
-
: image?.image?.scales?.larger?.download ||
|
|
40
|
-
image?.image_scales?.image[0]?.scales?.larger?.download;
|
|
41
|
-
|
|
42
|
-
if (checkUrlImage?.startsWith('@@')) {
|
|
43
|
-
checkUrlImage = image['@id'] + '/' + checkUrlImage;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
36
|
const closeModal = () => {
|
|
47
37
|
setViewIndex(null);
|
|
48
38
|
};
|
|
@@ -74,7 +64,6 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
|
|
|
74
64
|
{viewIndex != null && (
|
|
75
65
|
<>
|
|
76
66
|
<ModalHeader
|
|
77
|
-
closeButton={true}
|
|
78
67
|
closeAriaLabel={intl.formatMessage(messages.close_preview)}
|
|
79
68
|
toggle={closeModal}
|
|
80
69
|
>
|
|
@@ -98,17 +87,15 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
|
|
|
98
87
|
<Icon color="" icon="it-arrow-left" padding={false} />
|
|
99
88
|
</Button>
|
|
100
89
|
)}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
)}
|
|
111
|
-
</div>
|
|
90
|
+
|
|
91
|
+
{image && (
|
|
92
|
+
<Image
|
|
93
|
+
key={image['@id']}
|
|
94
|
+
itemUrl={image['@id']}
|
|
95
|
+
image={image['@id']}
|
|
96
|
+
alt={image.title}
|
|
97
|
+
/>
|
|
98
|
+
)}
|
|
112
99
|
|
|
113
100
|
{items.length > 1 && (
|
|
114
101
|
<Button
|
|
@@ -27,7 +27,8 @@ const ParentSiteMenu = () => {
|
|
|
27
27
|
// eslint-disable-next-line no-loop-func
|
|
28
28
|
dropdownMenu.forEach((m) => {
|
|
29
29
|
if (m.rootPath === s) {
|
|
30
|
-
menu
|
|
30
|
+
// Filter non visible dropdown menu entries
|
|
31
|
+
menu = { ...m, items: m.items.filter((mi) => mi.visible) };
|
|
31
32
|
i = 0;
|
|
32
33
|
}
|
|
33
34
|
});
|
|
@@ -7,7 +7,11 @@ import { fontAwesomeAliases } from 'design-comuni-plone-theme/helpers/index';
|
|
|
7
7
|
|
|
8
8
|
const FontAwesomeIcon = (props) => {
|
|
9
9
|
const { className, icon, prefix, title } = props;
|
|
10
|
-
const [loadedIcon, setLoadedIcon] = React.useState(
|
|
10
|
+
const [loadedIcon, setLoadedIcon] = React.useState({
|
|
11
|
+
module: null,
|
|
12
|
+
iconName: '',
|
|
13
|
+
family: 'solid',
|
|
14
|
+
});
|
|
11
15
|
|
|
12
16
|
const getIconAlias = (icon, aliasList) => {
|
|
13
17
|
if (icon in aliasList) {
|
|
@@ -17,40 +21,58 @@ const FontAwesomeIcon = (props) => {
|
|
|
17
21
|
}
|
|
18
22
|
};
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const getIconInfo = (icon, prefix) => {
|
|
25
|
+
let prefixKey = prefix;
|
|
26
|
+
let iconName = '';
|
|
27
|
+
if (Array.isArray(icon)) {
|
|
28
|
+
prefixKey = icon[0];
|
|
29
|
+
iconName = getIconAlias(icon[1], fontAwesomeAliases);
|
|
30
|
+
} else {
|
|
31
|
+
iconName = getIconAlias(icon, fontAwesomeAliases);
|
|
32
|
+
}
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
return [
|
|
35
|
+
prefixKey === 'fab'
|
|
36
|
+
? 'brands'
|
|
37
|
+
: prefixKey === 'far'
|
|
38
|
+
? 'regular'
|
|
39
|
+
: 'solid',
|
|
40
|
+
iconName,
|
|
41
|
+
];
|
|
42
|
+
};
|
|
32
43
|
|
|
33
44
|
React.useEffect(() => {
|
|
34
|
-
|
|
45
|
+
const [prefixFolder, iconName] = getIconInfo(icon, prefix);
|
|
46
|
+
if (
|
|
47
|
+
iconName &&
|
|
48
|
+
(iconName !== loadedIcon.iconName || prefixFolder !== loadedIcon.family)
|
|
49
|
+
) {
|
|
35
50
|
import(
|
|
36
51
|
`design-comuni-plone-theme/icons/fontawesome-free-6.4.0-web/svgs/${prefixFolder}/${iconName}.svg`
|
|
37
52
|
)
|
|
38
53
|
.then((_loadedIcon) => {
|
|
39
|
-
setLoadedIcon(
|
|
54
|
+
setLoadedIcon({
|
|
55
|
+
module: _loadedIcon.default,
|
|
56
|
+
iconName,
|
|
57
|
+
family: prefixFolder,
|
|
58
|
+
});
|
|
40
59
|
})
|
|
41
60
|
.catch((error) => {});
|
|
42
61
|
}
|
|
43
|
-
|
|
62
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
|
+
}, [icon, prefix, loadedIcon]);
|
|
44
64
|
|
|
45
|
-
return loadedIcon ? (
|
|
65
|
+
return loadedIcon.module ? (
|
|
46
66
|
<svg
|
|
47
|
-
xmlns={loadedIcon.attributes && loadedIcon.attributes.xmlns}
|
|
48
|
-
viewBox={
|
|
67
|
+
xmlns={loadedIcon.module.attributes && loadedIcon.module.attributes.xmlns}
|
|
68
|
+
viewBox={
|
|
69
|
+
loadedIcon.module.attributes && loadedIcon.module.attributes.viewBox
|
|
70
|
+
}
|
|
49
71
|
className={`icon fa-icon ${className ?? ''}`}
|
|
50
72
|
dangerouslySetInnerHTML={{
|
|
51
73
|
__html: title
|
|
52
|
-
? `<title>${title}</title>${loadedIcon.content}`
|
|
53
|
-
: loadedIcon.content,
|
|
74
|
+
? `<title>${title}</title>${loadedIcon.module.content}`
|
|
75
|
+
: loadedIcon.module.content,
|
|
54
76
|
}}
|
|
55
77
|
/>
|
|
56
78
|
) : icon ? (
|
|
@@ -7,23 +7,15 @@ import {
|
|
|
7
7
|
richTextHasContent,
|
|
8
8
|
} from 'design-comuni-plone-theme/components/ItaliaTheme/View';
|
|
9
9
|
|
|
10
|
+
import BandoTextTipologia from 'design-comuni-plone-theme/components/ItaliaTheme/View/BandoView/BandoTextTipologia';
|
|
11
|
+
import BandoTextDestinatari from 'design-comuni-plone-theme/components/ItaliaTheme/View/BandoView/BandoTextDestinatari';
|
|
12
|
+
import BandoTextEnte from 'design-comuni-plone-theme/components/ItaliaTheme/View/BandoView/BandoTextEnte';
|
|
13
|
+
|
|
10
14
|
const messages = defineMessages({
|
|
11
15
|
descrizione: {
|
|
12
16
|
id: 'descrizione_bando',
|
|
13
17
|
defaultMessage: 'Descrizione',
|
|
14
18
|
},
|
|
15
|
-
tipologia_bando: {
|
|
16
|
-
id: 'tipologia_bando',
|
|
17
|
-
defaultMessage: 'Tipologia del bando',
|
|
18
|
-
},
|
|
19
|
-
destinatari: {
|
|
20
|
-
id: 'bando_destinatari',
|
|
21
|
-
defaultMessage: 'Destinatari del bando',
|
|
22
|
-
},
|
|
23
|
-
ente: {
|
|
24
|
-
id: 'bando_ente',
|
|
25
|
-
defaultMessage: 'Ente erogatore',
|
|
26
|
-
},
|
|
27
19
|
});
|
|
28
20
|
|
|
29
21
|
const BandoText = ({ content }) => {
|
|
@@ -40,33 +32,11 @@ const BandoText = ({ content }) => {
|
|
|
40
32
|
{/* DESCRIZIONE DEL BANDO */}
|
|
41
33
|
{richTextHasContent(content?.text) && <RichText data={content?.text} />}
|
|
42
34
|
{/* TIPOLOGIA DEL BANDO */}
|
|
43
|
-
{content
|
|
44
|
-
<>
|
|
45
|
-
<h3 className="h5">{intl.formatMessage(messages.tipologia_bando)}</h3>
|
|
46
|
-
<span>{content.tipologia_bando.title}</span>
|
|
47
|
-
</>
|
|
48
|
-
)}
|
|
35
|
+
<BandoTextTipologia content={content} />
|
|
49
36
|
{/* DESTINATARI DEL BANDO */}
|
|
50
|
-
{content
|
|
51
|
-
<>
|
|
52
|
-
<h3 className="h5">{intl.formatMessage(messages.destinatari)}</h3>
|
|
53
|
-
{content.destinatari.map((item, i) => (
|
|
54
|
-
<p key={'destinatari-' + i}>{item.title}</p>
|
|
55
|
-
))}
|
|
56
|
-
</>
|
|
57
|
-
)}
|
|
37
|
+
<BandoTextDestinatari content={content} />
|
|
58
38
|
{/* ENTE DEL BANDO */}
|
|
59
|
-
{content
|
|
60
|
-
<>
|
|
61
|
-
<h3 className="h5">{intl.formatMessage(messages.ente)}</h3>
|
|
62
|
-
{content.ente_bando.map((item, i) => (
|
|
63
|
-
<span key={'ente_' + i}>
|
|
64
|
-
{item}
|
|
65
|
-
{i < content.ente_bando.length - 1 ? ', ' : ''}
|
|
66
|
-
</span>
|
|
67
|
-
))}
|
|
68
|
-
</>
|
|
69
|
-
)}
|
|
39
|
+
<BandoTextEnte content={content} />
|
|
70
40
|
</RichTextSection>
|
|
71
41
|
) : (
|
|
72
42
|
<></>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
const messages = defineMessages({
|
|
6
|
+
destinatari: {
|
|
7
|
+
id: 'bando_destinatari',
|
|
8
|
+
defaultMessage: 'Destinatari del bando',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const BandoTextDestinatari = ({ content }) => {
|
|
13
|
+
const intl = useIntl();
|
|
14
|
+
return content?.destinatari?.length > 0 ? (
|
|
15
|
+
<>
|
|
16
|
+
<h3 className="h5">{intl.formatMessage(messages.destinatari)}</h3>
|
|
17
|
+
{content.destinatari.map((item, i) => (
|
|
18
|
+
<p key={'destinatari-' + i}>{item.title}</p>
|
|
19
|
+
))}
|
|
20
|
+
</>
|
|
21
|
+
) : (
|
|
22
|
+
<></>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
BandoTextDestinatari.propTypes = {
|
|
27
|
+
content: PropTypes.shape({
|
|
28
|
+
destinatari: PropTypes.arrayOf(
|
|
29
|
+
PropTypes.shape({
|
|
30
|
+
title: PropTypes.string,
|
|
31
|
+
token: PropTypes.string,
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
}).isRequired,
|
|
35
|
+
};
|
|
36
|
+
export default BandoTextDestinatari;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
const messages = defineMessages({
|
|
6
|
+
ente: {
|
|
7
|
+
id: 'bando_ente',
|
|
8
|
+
defaultMessage: 'Ente erogatore',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const BandoTextEnte = ({ content }) => {
|
|
13
|
+
const intl = useIntl();
|
|
14
|
+
return content?.ente_bando?.length > 0 ? (
|
|
15
|
+
<>
|
|
16
|
+
<h3 className="h5">{intl.formatMessage(messages.ente)}</h3>
|
|
17
|
+
{content.ente_bando.map((item, i) => (
|
|
18
|
+
<span key={'ente_' + i}>
|
|
19
|
+
{item}
|
|
20
|
+
{i < content.ente_bando.length - 1 ? ', ' : ''}
|
|
21
|
+
</span>
|
|
22
|
+
))}
|
|
23
|
+
</>
|
|
24
|
+
) : (
|
|
25
|
+
<></>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
BandoTextEnte.propTypes = {
|
|
30
|
+
content: PropTypes.shape({
|
|
31
|
+
ente_bando: PropTypes.arrayOf(PropTypes.string),
|
|
32
|
+
}).isRequired,
|
|
33
|
+
};
|
|
34
|
+
export default BandoTextEnte;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
const messages = defineMessages({
|
|
6
|
+
tipologia_bando: {
|
|
7
|
+
id: 'tipologia_bando',
|
|
8
|
+
defaultMessage: 'Tipologia del bando',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const BandoTextTipologia = ({ content }) => {
|
|
13
|
+
const intl = useIntl();
|
|
14
|
+
return content?.tipologia_bando ? (
|
|
15
|
+
<>
|
|
16
|
+
<h3 className="h5">{intl.formatMessage(messages.tipologia_bando)}</h3>
|
|
17
|
+
<span>{content.tipologia_bando.title}</span>
|
|
18
|
+
</>
|
|
19
|
+
) : (
|
|
20
|
+
<></>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
BandoTextTipologia.propTypes = {
|
|
25
|
+
content: PropTypes.shape({
|
|
26
|
+
tipologia_bando: PropTypes.shape({
|
|
27
|
+
title: PropTypes.string,
|
|
28
|
+
token: PropTypes.string,
|
|
29
|
+
}),
|
|
30
|
+
}).isRequired,
|
|
31
|
+
};
|
|
32
|
+
export default BandoTextTipologia;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importante: (06/11/2023)
|
|
3
|
+
* Component creato per essere possibile customizzare in modo più efficiente le traduzioni per lo status dei bandi.
|
|
4
|
+
* Deve essere cancellato dopo l'aggiornamento di Volto
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
8
|
+
|
|
9
|
+
const messages = defineMessages({
|
|
10
|
+
open: {
|
|
11
|
+
id: 'bando_open',
|
|
12
|
+
defaultMessage: 'Attivo',
|
|
13
|
+
},
|
|
14
|
+
closed: {
|
|
15
|
+
id: 'bando_closed',
|
|
16
|
+
defaultMessage: 'Scaduto',
|
|
17
|
+
},
|
|
18
|
+
inProgress: {
|
|
19
|
+
id: 'bando_inProgress',
|
|
20
|
+
defaultMessage: 'In corso',
|
|
21
|
+
},
|
|
22
|
+
scheduled: {
|
|
23
|
+
id: 'bando_scheduled',
|
|
24
|
+
defaultMessage: 'Programmato',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* BandoStatus view component class.
|
|
30
|
+
* @function BandoStatus
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
const BandoStatus = ({ content }) => {
|
|
34
|
+
const intl = useIntl();
|
|
35
|
+
return <>{intl.formatMessage(messages[content.bando_state[0]])}</>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default BandoStatus;
|