design-comuni-plone-theme 11.26.4 → 11.26.5

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.
Files changed (50) hide show
  1. package/.yarn/cache/{volto-venue-npm-4.1.0-481d5ba425-64ca36bc93.zip → volto-venue-npm-4.1.1-d5be247928-f796d519ad.zip} +0 -0
  2. package/.yarn/install-state.gz +0 -0
  3. package/CHANGELOG.md +24 -0
  4. package/RELEASE.md +22 -0
  5. package/locales/de/LC_MESSAGES/volto.po +8 -7
  6. package/locales/en/LC_MESSAGES/volto.po +9 -8
  7. package/locales/es/LC_MESSAGES/volto.po +8 -7
  8. package/locales/fr/LC_MESSAGES/volto.po +8 -7
  9. package/locales/it/LC_MESSAGES/volto.po +9 -8
  10. package/locales/volto.pot +9 -8
  11. package/package.json +2 -2
  12. package/publiccode.yml +2 -2
  13. package/src/components/ImageWithErrors/ImageWithErrors.jsx +0 -1
  14. package/src/components/ItaliaTheme/Blocks/Listing/AttachmentCardTemplate.jsx +13 -10
  15. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImage/CardWithImageDefault.jsx +7 -7
  16. package/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx +35 -13
  17. package/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx +16 -10
  18. package/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx +12 -9
  19. package/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx +7 -7
  20. package/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx +9 -8
  21. package/src/components/ItaliaTheme/Blocks/Listing/PhotogalleryTemplate.jsx +7 -6
  22. package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +9 -6
  23. package/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx +19 -23
  24. package/src/components/ItaliaTheme/Cards/CardPersona.jsx +5 -8
  25. package/src/components/ItaliaTheme/View/Commons/GenericCard.jsx +14 -13
  26. package/src/components/ItaliaTheme/View/Commons/LocationItem.jsx +15 -9
  27. package/src/components/ItaliaTheme/View/Commons/OfficeCard.jsx +7 -3
  28. package/src/components/ItaliaTheme/View/Commons/Sponsors.jsx +14 -10
  29. package/src/components/ItaliaTheme/View/Commons/VenuesSmall.jsx +13 -6
  30. package/src/components/ItaliaTheme/View/EventoView/EventoContatti.jsx +8 -7
  31. package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno.jsx +1 -12
  32. package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreInterno.jsx +1 -12
  33. package/src/components/ItaliaTheme/View/EventoView/EventoOrganizzatoDa.jsx +38 -0
  34. package/src/components/ItaliaTheme/View/EventoView/EventoPatrocinatoDa.jsx +38 -0
  35. package/src/components/ItaliaTheme/View/EventoView/EventoUlterioriInformazioni.jsx +0 -18
  36. package/src/components/ItaliaTheme/View/NewsItemView/NewsItemText.jsx +1 -0
  37. package/src/components/SelectInput/SelectInput.jsx +9 -4
  38. package/src/config/Blocks/ListingOptions/attachmentCardTemplate.js +1 -1
  39. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +15 -11
  40. package/src/customizations/volto/components/theme/View/ListingView.jsx +3 -3
  41. package/src/helpers/images.js +25 -1
  42. package/src/helpers/index.js +4 -1
  43. package/src/theme/ItaliaTheme/Blocks/_cardWithImage.scss +4 -0
  44. package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +9 -0
  45. package/src/theme/ItaliaTheme/Components/_cardLocationItem.scss +12 -0
  46. package/src/theme/ItaliaTheme/Components/_cardPersona.scss +19 -1
  47. package/src/theme/ItaliaTheme/Widgets/_blocksWidget.scss +36 -0
  48. package/src/theme/_cms-ui.scss +21 -0
  49. package/src/theme/bootstrap-override/_bootstrap-italia-site.scss +1 -0
  50. package/src/theme/bootstrap-override/bootstrap-italia/_avatar.scss +28 -0
@@ -7,7 +7,7 @@ import {
7
7
  ListingLinkMore,
8
8
  } from 'design-comuni-plone-theme/components/ItaliaTheme';
9
9
  import { defineMessages, useIntl } from 'react-intl';
10
-
10
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
11
11
  import PropTypes from 'prop-types';
12
12
  import React from 'react';
13
13
  import { UniversalLink } from '@plone/volto/components';
@@ -55,12 +55,11 @@ const GridGalleryTemplate = ({
55
55
  )}
56
56
  <div className="grid-gallery-grid">
57
57
  {items.map((item, index) => {
58
- let image = ListingImage({
59
- item,
60
- className: '',
61
- showTitleAttr: false,
62
- });
58
+ let image = (
59
+ <ListingImage item={item} className="" showTitleAttr={false} />
60
+ );
63
61
  let scale = null;
62
+ let hasImage = contentHasImage(item);
64
63
  if (index % 7 === 0 || index % 7 === 6 || index % 7 === 3) {
65
64
  scale = 'great';
66
65
  }
@@ -83,6 +82,7 @@ const GridGalleryTemplate = ({
83
82
  loading={critical ? 'eager' : 'lazy'}
84
83
  />
85
84
  );
85
+ hasImage = true;
86
86
  }
87
87
 
88
88
  return (
@@ -94,7 +94,7 @@ const GridGalleryTemplate = ({
94
94
  item={!isEditMode ? item : null}
95
95
  href={isEditMode ? '#' : null}
96
96
  >
97
- {image && (
97
+ {hasImage && (
98
98
  <picture className="volto-image responsive">
99
99
  {image}
100
100
  </picture>
@@ -23,6 +23,7 @@ import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
23
23
  import {
24
24
  getCalendarDate,
25
25
  getEventRecurrenceMore,
26
+ contentHasImage,
26
27
  } from 'design-comuni-plone-theme/helpers';
27
28
  import {
28
29
  CardCalendar,
@@ -87,11 +88,7 @@ const InEvidenceTemplate = (props) => {
87
88
  const listingText = show_description ? (
88
89
  <ListingText item={item} />
89
90
  ) : null;
90
- const image = ListingImage({
91
- item,
92
- sizes: '(max-width:320px) 200px, 300px',
93
- showTitleAttr: false,
94
- });
91
+ const hasImage = contentHasImage(item);
95
92
  const category = getCategory(item, show_type, show_section, props);
96
93
  const topics = show_topics ? item.tassonomia_argomenti : null;
97
94
 
@@ -103,7 +100,7 @@ const InEvidenceTemplate = (props) => {
103
100
  <CardPersona
104
101
  item={item}
105
102
  className="listing-item card-bg"
106
- showImage={image ? true : false}
103
+ showImage={hasImage}
107
104
  show_description={show_description}
108
105
  icon={icon}
109
106
  isEditMode={isEditMode}
@@ -111,10 +108,14 @@ const InEvidenceTemplate = (props) => {
111
108
  />
112
109
  ) : (
113
110
  <Card key={index} className={cx('listing-item card-bg')}>
114
- {index === 0 && image && (
111
+ {index === 0 && hasImage && (
115
112
  <div className="img-responsive-wrapper">
116
113
  <div className="img-responsive">
117
- {image}
114
+ <ListingImage
115
+ item={item}
116
+ sizes="(max-width:320px) 200px, 300px"
117
+ showTitleAttr={false}
118
+ />
118
119
  {item['@type'] === 'Event' && (
119
120
  <CardCalendar start={item.start} end={item.end} />
120
121
  )}
@@ -127,10 +127,10 @@ const PhotogalleryTemplate = ({
127
127
 
128
128
  const getCaption = (item) => item.description ?? item.rights ?? null;
129
129
 
130
- const figure = (image, item) => {
130
+ const figure = (imageProps, item) => {
131
131
  return (
132
132
  <figure className="img-wrapper volto-image responsive">
133
- {image}
133
+ <ListingImage {...imageProps} />
134
134
  {getCaption(item) && <figcaption>{getCaption(item)}</figcaption>}
135
135
  </figure>
136
136
  );
@@ -152,7 +152,7 @@ const PhotogalleryTemplate = ({
152
152
  <CarouselWrapper className="it-card-bg">
153
153
  <Slider {...settings} ref={slider}>
154
154
  {items.map((item, i) => {
155
- const image = ListingImage({
155
+ const imageProps = {
156
156
  item,
157
157
  sizes: `(max-width:600px) 450px, (max-width:1024px) ${
158
158
  items.length < 2 ? '1000' : '500'
@@ -164,7 +164,8 @@ const PhotogalleryTemplate = ({
164
164
  : '450'
165
165
  }px`,
166
166
  noWrapLink: true,
167
- });
167
+ showDefault: true,
168
+ };
168
169
  return (
169
170
  <SingleSlideWrapper
170
171
  className={cx('', {
@@ -179,7 +180,7 @@ const PhotogalleryTemplate = ({
179
180
  openLinkInNewTab={true}
180
181
  title={intl.formatMessage(messages.viewImage)}
181
182
  >
182
- {figure(image, item)}
183
+ {figure(imageProps, item)}
183
184
  </UniversalLink>
184
185
  ) : (
185
186
  <a
@@ -204,7 +205,7 @@ const PhotogalleryTemplate = ({
204
205
  messages.viewPreview,
205
206
  )} ${item.title}`}
206
207
  >
207
- {figure(image, item)}
208
+ {figure(imageProps, item)}
208
209
  </a>
209
210
  )}
210
211
  </SingleSlideWrapper>
@@ -218,12 +218,15 @@ const SliderTemplate = ({
218
218
 
219
219
  <Slider {...settings} ref={slider}>
220
220
  {items.map((item, index) => {
221
- const image = ListingImage({
222
- item,
223
- loading: index === 0 ? 'eager' : 'lazy',
224
- sizes: `max-width(991px) 620px, ${1300 / nSlidesToShow}px`,
225
- critical: true,
226
- });
221
+ const image = (
222
+ <ListingImage
223
+ item={item}
224
+ loading={index === 0 ? 'eager' : 'lazy'}
225
+ sizes={`max-width(991px) 620px, ${1300 / nSlidesToShow}px`}
226
+ critical
227
+ showDefault
228
+ />
229
+ );
227
230
  const nextIndex = index < items.length - 1 ? index + 1 : null;
228
231
  const prevIndex = index > 0 ? index - 1 : null;
229
232
  return (
@@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
6
6
  import { Container, Row, Col } from 'design-react-kit';
7
7
  import { UniversalLink } from '@plone/volto/components';
8
8
  import cx from 'classnames';
9
-
10
9
  import {
11
10
  ListingLinkMore,
12
11
  ListingImage,
@@ -38,34 +37,31 @@ const SmallBlockLinksTemplate = ({
38
37
  )}
39
38
  <Row className="items">
40
39
  {items.map((item, index) => {
41
- const image = ListingImage({
42
- item,
43
- sizes: '(max-width:575px) 520px, 200px',
44
- style: {},
45
- alt: item.title,
46
- noWrapLink: true,
47
- });
48
-
49
40
  return (
50
41
  <Col
51
42
  md="3"
52
43
  key={item['@id']}
53
44
  className="col-item col-sm-4 col-lg-2"
54
45
  >
55
- {image && (
56
- <div className="center-image-card">
57
- <UniversalLink
58
- item={!isEditMode ? item : null}
59
- href={isEditMode ? '#' : ''}
60
- className="img-link"
61
- overrideMarkSpecialLinks={
62
- override_links_accessibility_marker
63
- }
64
- >
65
- {image}
66
- </UniversalLink>
67
- </div>
68
- )}
46
+ <div className="center-image-card">
47
+ <UniversalLink
48
+ item={!isEditMode ? item : null}
49
+ href={isEditMode ? '#' : ''}
50
+ className="img-link"
51
+ overrideMarkSpecialLinks={
52
+ override_links_accessibility_marker
53
+ }
54
+ >
55
+ <ListingImage
56
+ item={item}
57
+ sizes="(max-width:575px) 520px, 200px"
58
+ style={{}}
59
+ alt={item.title}
60
+ noWrapLink
61
+ showDefault
62
+ />
63
+ </UniversalLink>
64
+ </div>
69
65
  </Col>
70
66
  );
71
67
  })}
@@ -8,6 +8,7 @@ import {
8
8
  ListingCategory,
9
9
  ListingImage,
10
10
  } from 'design-comuni-plone-theme/components/ItaliaTheme';
11
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
11
12
 
12
13
  export const CardPersona = ({
13
14
  item,
@@ -20,13 +21,7 @@ export const CardPersona = ({
20
21
  type,
21
22
  isEditMode,
22
23
  }) => {
23
- const image = ListingImage({
24
- item,
25
- sizes: '130px',
26
- showTitleAttr: false,
27
- });
28
-
29
- const hasImage = image !== null && showImage;
24
+ const hasImage = contentHasImage(item) && showImage;
30
25
 
31
26
  return (
32
27
  <Card
@@ -58,7 +53,9 @@ export const CardPersona = ({
58
53
  )}
59
54
  </CardBody>
60
55
  {hasImage && (
61
- <div className="card-image card-image-rounded">{image}</div>
56
+ <div className="card-image card-image-rounded">
57
+ <ListingImage item={item} sizes="130px" showTitleAttr={false} />
58
+ </div>
62
59
  )}
63
60
  </div>
64
61
  </Card>
@@ -4,7 +4,10 @@ import cx from 'classnames';
4
4
 
5
5
  import { UniversalLink } from '@plone/volto/components';
6
6
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
7
- import { getCalendarDate } from 'design-comuni-plone-theme/helpers';
7
+ import {
8
+ getCalendarDate,
9
+ contentHasImage,
10
+ } from 'design-comuni-plone-theme/helpers';
8
11
  import {
9
12
  Icon,
10
13
  CardCategory,
@@ -48,23 +51,21 @@ const GenericCard = ({
48
51
  </>
49
52
  );
50
53
  const cooked_image_field = image_field || item.image_field;
51
- // (item.preview_image ? 'preview_image' : 'image');
52
- const image =
53
- showimage &&
54
- item &&
55
- Image({
56
- item: item,
57
- imageField: cooked_image_field,
58
- alt: '',
59
- title: item.title,
60
- });
54
+ const showImage = showimage && contentHasImage(item) && cooked_image_field;
61
55
 
62
56
  return item ? (
63
- image ? (
57
+ showImage ? (
64
58
  <div className={cx('genericcard card shadow rounded mt-3')}>
65
59
  <div className="img-responsive-wrapper">
66
60
  <div className="img-responsive img-responsive-panoramic">
67
- <figure className="img-wrapper">{image}</figure>
61
+ <figure className="img-wrapper">
62
+ <Image
63
+ item={item}
64
+ imageField={cooked_image_field}
65
+ alt={''}
66
+ title={item.title}
67
+ />
68
+ </figure>
68
69
  </div>
69
70
  </div>
70
71
  <div className="card-body px-4">
@@ -8,6 +8,7 @@ import { UniversalLink } from '@plone/volto/components';
8
8
  import PropTypes from 'prop-types';
9
9
  import { flattenToAppURL } from '@plone/volto/helpers';
10
10
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
11
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
11
12
  import config from '@plone/volto/registry';
12
13
 
13
14
  const messages = defineMessages({
@@ -41,24 +42,25 @@ const LocationItem = ({
41
42
  }) => {
42
43
  const intl = useIntl();
43
44
  const Image = config.getComponent({ name: 'Image' }).component;
44
- const image = Image({ item: location, sizes: '80px', loading: 'lazy' });
45
+ const showImage = contentHasImage(location) && location['@type'] === 'Venue';
45
46
  const address = ['street', 'city', 'zip_code']
46
47
  .map((key) => location?.[key])
47
48
  .filter(Boolean)
48
49
  .join(' - ');
49
50
 
50
51
  return location ? (
51
- <div className="card card-teaser shadow mt-3 border-left-card card-big-io-comune p-4 rounded location-item">
52
- {show_icon && (
53
- <Icon
54
- icon={'it-pin'}
55
- title={intl.formatMessage(messages.icona_luoghi)}
56
- />
57
- )}
52
+ <div className="card card-teaser shadow mt-3 border-left-card card-big-io-comune pt-4 pb-4 ps-3 pe-4 rounded location-item">
58
53
  <div className="card-body">
59
54
  <div className="card-title h5 venue-card-title">
60
55
  {(location.nome_sede || location.title) && (
61
56
  <>
57
+ {show_icon && (
58
+ <Icon
59
+ icon={'it-pin'}
60
+ title={intl.formatMessage(messages.icona_luoghi)}
61
+ className="pin-icon"
62
+ />
63
+ )}
62
64
  {location['@type'] === 'Venue' ||
63
65
  (location['@type'] === 'UnitaOrganizzativa' &&
64
66
  show_title_link) ? (
@@ -104,7 +106,11 @@ const LocationItem = ({
104
106
  )}
105
107
  </div>
106
108
  </div>
107
- {image && <div className="avatar size-xl">{image}</div>}
109
+ {showImage && (
110
+ <div className="avatar size-lg">
111
+ <Image item={location} sizes="80px" loading="lazy" />
112
+ </div>
113
+ )}
108
114
  </div>
109
115
  ) : (
110
116
  ''
@@ -3,6 +3,7 @@ import { UniversalLink } from '@plone/volto/components';
3
3
  import PropTypes from 'prop-types';
4
4
  import cx from 'classnames';
5
5
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
6
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
6
7
  import config from '@plone/volto/registry';
7
8
 
8
9
  /**
@@ -24,8 +25,7 @@ const OfficeCard = ({
24
25
  }) => {
25
26
  const intl = useIntl();
26
27
  const Image = config.getComponent({ name: 'Image' }).component;
27
- const image =
28
- showimage && Image({ item: office, sizes: '80px', loading: 'lazy' });
28
+ const showImage = showimage && contentHasImage(office);
29
29
 
30
30
  return (
31
31
  <div
@@ -74,7 +74,11 @@ const OfficeCard = ({
74
74
 
75
75
  {children && <div className="card-text">{children}</div>}
76
76
  </div>
77
- {image && <div className="image-container">{image}</div>}
77
+ {showImage && (
78
+ <div className="avatar size-lg">
79
+ <Image item={office} sizes="80px" loading="lazy" />
80
+ </div>
81
+ )}
78
82
  </div>
79
83
  );
80
84
  };
@@ -4,6 +4,7 @@ import React, { useEffect } from 'react';
4
4
  import { searchContent, resetSearchContent } from '@plone/volto/actions';
5
5
  import { flattenToAppURL } from '@plone/volto/helpers';
6
6
  import PropTypes from 'prop-types';
7
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
7
8
  import { UniversalLink } from '@plone/volto/components';
8
9
  import config from '@plone/volto/registry';
9
10
 
@@ -23,19 +24,22 @@ const messages = defineMessages({
23
24
  */
24
25
  const Sponsor = ({ item }) => {
25
26
  const Image = config.getComponent({ name: 'Image' }).component;
26
- const image =
27
- item?.image &&
28
- Image({
29
- item: item,
30
- sizes: '600px',
31
- loading: 'lazy',
32
- className: 'img-fluid',
33
- alt: item.image.filename ?? item.title,
34
- });
27
+ const showImage = contentHasImage(item);
28
+
35
29
  return item ? (
36
30
  <div className="sponsor-item">
37
31
  <UniversalLink href={item.remoteUrl}>
38
- {image ? image : item.title}
32
+ {showImage ? (
33
+ <Image
34
+ item={item}
35
+ sizes="600px"
36
+ loading="lazy"
37
+ className="img-fluid"
38
+ alt={item.image.filename ?? item.title}
39
+ />
40
+ ) : (
41
+ item.title
42
+ )}
39
43
  </UniversalLink>
40
44
  </div>
41
45
  ) : null;
@@ -2,6 +2,7 @@ import { defineMessages, useIntl } from 'react-intl';
2
2
  import { Link } from 'react-router-dom';
3
3
  import PropTypes from 'prop-types';
4
4
  import { flattenToAppURL } from '@plone/volto/helpers';
5
+ import { contentHasImage } from 'design-comuni-plone-theme/helpers';
5
6
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
6
7
  import config from '@plone/volto/registry';
7
8
 
@@ -26,13 +27,15 @@ const messages = defineMessages({
26
27
  const Location = ({ location, show_icon }) => {
27
28
  const intl = useIntl();
28
29
  const Image = config.getComponent({ name: 'Image' }).component;
29
- const image = Image({ item: location, loading: 'lazy', sizes: '80px' });
30
+ const showImage = contentHasImage(location);
30
31
  return (
31
32
  location && (
32
- <div className="card card-teaser shadow border-left-card mt-3 rounded location-item">
33
- {show_icon && <Icon icon={'it-pin'} />}
33
+ <div className="card card-teaser shadow border-left-card mt-3 card-small rounded location-item">
34
34
  <div className="card-body">
35
- <div className="card-title h5">{location.title}</div>
35
+ <div className="card-title h5">
36
+ {show_icon && <Icon icon={'it-pin'} />}
37
+ {location.title}
38
+ </div>
36
39
  <div className="card-text">
37
40
  {(location.street || location.zip_code) && (
38
41
  <p>
@@ -51,7 +54,11 @@ const Location = ({ location, show_icon }) => {
51
54
  </p>
52
55
  </div>
53
56
  </div>
54
- {image && <div className="avatar size-xl">{image}</div>}
57
+ {showImage && (
58
+ <div className="avatar size-lg">
59
+ <Image item={location} loading="lazy" sizes="80px" />
60
+ </div>
61
+ )}
55
62
  </div>
56
63
  )
57
64
  );
@@ -65,7 +72,7 @@ const Location = ({ location, show_icon }) => {
65
72
  */
66
73
  const VenuesSmall = ({ venues, show_icon }) => {
67
74
  return venues ? (
68
- <div className="card-wrapper card-teaser-wrapper">
75
+ <div className="card-wrapper card-teaser-wrapper align-items-stretch">
69
76
  {venues.map((item) => (
70
77
  <Location key={item['@id']} location={item} show_icon={show_icon} />
71
78
  ))}
@@ -5,9 +5,10 @@ import {
5
5
  RichTextSection,
6
6
  ContactsCard,
7
7
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
8
- import EventoContattiOrganizzatoreEsterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno';
9
- import EventoContattiOrganizzatoreInterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreInterno';
8
+
10
9
  import EventoContattiSupportatoDa from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiSupportatoDa';
10
+ import EventoOrganizzatoDa from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoOrganizzatoDa';
11
+ import EventoPatrocinatoDa from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoPatrocinatoDa';
11
12
 
12
13
  const messages = defineMessages({
13
14
  contatti: {
@@ -31,14 +32,14 @@ const EventoContatti = ({ content }) => {
31
32
  <ContactsCard contact={contact} key={contact['@id']} />
32
33
  ))}
33
34
 
34
- {/* ---organizzato da esterno */}
35
- <EventoContattiOrganizzatoreEsterno content={content} />
36
-
37
- {/* ---contatti interno */}
38
- <EventoContattiOrganizzatoreInterno content={content} />
35
+ {/* ---organizzato da */}
36
+ <EventoOrganizzatoDa content={content} />
39
37
 
40
38
  {/* ---supportato da */}
41
39
  <EventoContattiSupportatoDa content={content} />
40
+
41
+ {/* ---patrocinato da */}
42
+ <EventoPatrocinatoDa content={content} />
42
43
  </RichTextSection>
43
44
  ) : null;
44
45
  };
@@ -1,5 +1,4 @@
1
1
  import PropTypes from 'prop-types';
2
- import { defineMessages, useIntl } from 'react-intl';
3
2
  import { Card, CardBody } from 'design-react-kit';
4
3
  import {
5
4
  RichText,
@@ -7,22 +6,12 @@ import {
7
6
  ContactLink,
8
7
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
9
8
 
10
- const messages = defineMessages({
11
- organizzatore: {
12
- id: 'organizzatore',
13
- defaultMessage: 'Organizzatore',
14
- },
15
- });
16
-
17
9
  const EventoContattiOrganizzatoreEsterno = ({ content }) => {
18
- const intl = useIntl();
19
-
20
10
  return richTextHasContent(content?.organizzato_da_esterno) ||
21
11
  content?.telefono ||
22
12
  content?.email ||
23
13
  content?.fax ? (
24
- <div className="mb-5 mt-3">
25
- <h3 className="h5">{intl.formatMessage(messages.organizzatore)}</h3>
14
+ <div className="mb-5">
26
15
  <Card
27
16
  className="card card-teaser rounded shadow mt-3"
28
17
  noWrapper={true}
@@ -1,23 +1,12 @@
1
1
  import PropTypes from 'prop-types';
2
- import { defineMessages, useIntl } from 'react-intl';
3
2
  import {
4
3
  richTextHasContent,
5
4
  OfficeCard,
6
5
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
7
6
 
8
- const messages = defineMessages({
9
- organizzato_da: {
10
- id: 'organizzato_da',
11
- defaultMessage: 'Organizzato da',
12
- },
13
- });
14
-
15
7
  const EventoContattiOrganizzatoreInterno = ({ content }) => {
16
- const intl = useIntl();
17
-
18
8
  return content?.organizzato_da_interno?.length > 0 ? (
19
- <div className="mb-5">
20
- <h3 className="h5">{intl.formatMessage(messages.organizzato_da)}</h3>
9
+ <div className="mb-3">
21
10
  {content?.organizzato_da_interno?.map((item, index) => (
22
11
  <OfficeCard
23
12
  margin_bottom={index < content?.organizzato_da_interno?.length - 1}
@@ -0,0 +1,38 @@
1
+ import { defineMessages, useIntl } from 'react-intl';
2
+ import { richTextHasContent } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
3
+ import EventoContattiOrganizzatoreInterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreInterno';
4
+ import EventoContattiOrganizzatoreEsterno from 'design-comuni-plone-theme/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno';
5
+
6
+ const messages = defineMessages({
7
+ organizzato_da: {
8
+ id: 'organizzato_da',
9
+ defaultMessage: 'Organizzato da',
10
+ },
11
+ });
12
+
13
+ const EventoOrganizzatoDa = ({ content }) => {
14
+ const intl = useIntl();
15
+
16
+ return content?.organizzato_da_interno?.length > 0 ||
17
+ richTextHasContent(content?.organizzato_da_esterno) ||
18
+ content?.telefono ||
19
+ content?.email ||
20
+ content?.fax ? (
21
+ <div className="mb-5 mt-3">
22
+ <h3 className="h5 mb-3">{intl.formatMessage(messages.organizzato_da)}</h3>
23
+
24
+ {content?.organizzato_da_interno.length > 0 && (
25
+ <EventoContattiOrganizzatoreInterno content={content} />
26
+ )}
27
+
28
+ {(richTextHasContent(content?.organizzato_da_esterno) ||
29
+ content?.telefono ||
30
+ content?.email ||
31
+ content?.fax) && (
32
+ <EventoContattiOrganizzatoreEsterno content={content} />
33
+ )}
34
+ </div>
35
+ ) : null;
36
+ };
37
+
38
+ export default EventoOrganizzatoDa;
@@ -0,0 +1,38 @@
1
+ import { defineMessages, useIntl } from 'react-intl';
2
+ import { Card, CardBody } from 'design-react-kit';
3
+
4
+ import {
5
+ richTextHasContent,
6
+ RichText,
7
+ } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
8
+
9
+ const messages = defineMessages({
10
+ patrocinato_da: {
11
+ id: 'patrocinato_da',
12
+ defaultMessage: 'Patrocinato da',
13
+ },
14
+ });
15
+
16
+ const EventoPatrocinatoDa = ({ content }) => {
17
+ const intl = useIntl();
18
+ return richTextHasContent(content?.patrocinato_da) ? (
19
+ <div className="mb-5">
20
+ <h3 className="mt-4 patrocinato-da h5">
21
+ {intl.formatMessage(messages.patrocinato_da)}
22
+ </h3>
23
+ <Card
24
+ className="card card-teaser rounded shadow mt-3"
25
+ noWrapper={true}
26
+ tag="div"
27
+ >
28
+ <CardBody tag="div" className={'card-body pe-3'}>
29
+ <div className="mb-5">
30
+ <RichText data={content?.patrocinato_da} />
31
+ </div>
32
+ </CardBody>
33
+ </Card>
34
+ </div>
35
+ ) : null;
36
+ };
37
+
38
+ export default EventoPatrocinatoDa;