design-comuni-plone-theme 11.26.4 → 11.27.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.
Files changed (85) 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 +53 -0
  4. package/RELEASE.md +38 -0
  5. package/locales/de/LC_MESSAGES/volto.po +102 -7
  6. package/locales/en/LC_MESSAGES/volto.po +104 -9
  7. package/locales/es/LC_MESSAGES/volto.po +102 -7
  8. package/locales/fr/LC_MESSAGES/volto.po +102 -7
  9. package/locales/it/LC_MESSAGES/volto.po +103 -8
  10. package/locales/volto.pot +103 -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/Accordion/Block/ViewBlock.jsx +1 -0
  15. package/src/components/ItaliaTheme/Blocks/Listing/AttachmentCardTemplate.jsx +13 -10
  16. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImage/CardWithImageDefault.jsx +7 -7
  17. package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +23 -14
  18. package/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx +51 -16
  19. package/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx +15 -10
  20. package/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx +11 -9
  21. package/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx +4 -3
  22. package/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx +8 -8
  23. package/src/components/ItaliaTheme/Blocks/Listing/PhotogalleryTemplate.jsx +7 -6
  24. package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +9 -6
  25. package/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx +19 -23
  26. package/src/components/ItaliaTheme/Blocks/__tests__/Accordion.test.jsx +0 -3
  27. package/src/components/ItaliaTheme/Cards/CardPersona.jsx +5 -8
  28. package/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx +9 -1
  29. package/src/components/ItaliaTheme/Header/HeaderSearch/HeaderSearch.jsx +9 -1
  30. package/src/components/ItaliaTheme/Header/HeaderSearch/SearchModal.jsx +10 -1
  31. package/src/components/ItaliaTheme/Header/HeaderSlim/HeaderSlim.jsx +15 -2
  32. package/src/components/ItaliaTheme/Header/HeaderSlim/TertiaryMenu.jsx +1 -1
  33. package/src/components/ItaliaTheme/Header/ParentSiteMenu.jsx +14 -1
  34. package/src/components/ItaliaTheme/SkipLinks/SkipLinks.jsx +9 -1
  35. package/src/components/ItaliaTheme/View/BandoView/BandoView.jsx +19 -1
  36. package/src/components/ItaliaTheme/View/Commons/GenericCard.jsx +14 -13
  37. package/src/components/ItaliaTheme/View/Commons/LocationItem.jsx +15 -9
  38. package/src/components/ItaliaTheme/View/Commons/OfficeCard.jsx +7 -3
  39. package/src/components/ItaliaTheme/View/Commons/PageHeader/PageHeader.jsx +3 -4
  40. package/src/components/ItaliaTheme/View/Commons/RelatedItemInEvidence/RelatedItemInEvidence.jsx +14 -1
  41. package/src/components/ItaliaTheme/View/Commons/RelatedItems.jsx +5 -1
  42. package/src/components/ItaliaTheme/View/Commons/SideMenu.jsx +10 -6
  43. package/src/components/ItaliaTheme/View/Commons/Sponsors.jsx +14 -10
  44. package/src/components/ItaliaTheme/View/Commons/VenuesSmall.jsx +13 -6
  45. package/src/components/ItaliaTheme/View/DocumentoView/DocumentoView.jsx +20 -1
  46. package/src/components/ItaliaTheme/View/EventoView/EventoContatti.jsx +8 -7
  47. package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno.jsx +1 -12
  48. package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreInterno.jsx +1 -12
  49. package/src/components/ItaliaTheme/View/EventoView/EventoOrganizzatoDa.jsx +38 -0
  50. package/src/components/ItaliaTheme/View/EventoView/EventoPatrocinatoDa.jsx +38 -0
  51. package/src/components/ItaliaTheme/View/EventoView/EventoUlterioriInformazioni.jsx +0 -18
  52. package/src/components/ItaliaTheme/View/EventoView/EventoView.jsx +20 -1
  53. package/src/components/ItaliaTheme/View/FAQ/FaqFolder/SearchBar.jsx +2 -0
  54. package/src/components/ItaliaTheme/View/NewsItemView/NewsItemText.jsx +1 -0
  55. package/src/components/ItaliaTheme/View/NewsItemView/NewsItemView.jsx +19 -1
  56. package/src/components/ItaliaTheme/View/PaginaArgomentoView/PaginaArgomentoViewNoBlocks.jsx +14 -1
  57. package/src/components/ItaliaTheme/View/PersonaView/PersonaView.jsx +20 -1
  58. package/src/components/ItaliaTheme/View/ServizioView/ServizioView.jsx +19 -2
  59. package/src/components/ItaliaTheme/View/UOView/UOView.jsx +20 -1
  60. package/src/components/ItaliaTheme/View/VenueView/VenueView.jsx +24 -11
  61. package/src/components/SelectInput/SelectInput.jsx +10 -4
  62. package/src/components/TextInput.jsx +1 -0
  63. package/src/config/Blocks/ListingOptions/attachmentCardTemplate.js +1 -1
  64. package/src/config/Blocks/ListingOptions/cardWithSlideUpTextTemplate.js +1 -6
  65. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +15 -11
  66. package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +5 -2
  67. package/src/customizations/volto/components/theme/Navigation/Navigation.jsx +16 -2
  68. package/src/customizations/volto/components/theme/View/ListingView.jsx +3 -3
  69. package/src/customizations/volto/helpers/FormValidation/FormValidation.js +8 -5
  70. package/src/customizations/volto-form-block/components/Field.jsx +7 -0
  71. package/src/customizations/volto-form-block/fieldSchema.js +345 -0
  72. package/src/helpers/images.js +25 -1
  73. package/src/helpers/index.js +4 -1
  74. package/src/overrideTranslations.jsx +4 -0
  75. package/src/theme/ItaliaTheme/Blocks/_cardWithImage.scss +5 -0
  76. package/src/theme/ItaliaTheme/Blocks/_cardWithSlideUpTextTemplate.scss +10 -0
  77. package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +9 -0
  78. package/src/theme/ItaliaTheme/Blocks/_search.scss +8 -2
  79. package/src/theme/ItaliaTheme/Components/_cardLocationItem.scss +12 -0
  80. package/src/theme/ItaliaTheme/Components/_cardPersona.scss +21 -1
  81. package/src/theme/ItaliaTheme/Widgets/_blocksWidget.scss +36 -0
  82. package/src/theme/ItaliaTheme/_ar.scss +3 -2
  83. package/src/theme/_cms-ui.scss +21 -0
  84. package/src/theme/bootstrap-override/_bootstrap-italia-site.scss +1 -0
  85. package/src/theme/bootstrap-override/bootstrap-italia/_avatar.scss +28 -0
@@ -9,8 +9,17 @@ import { Link } from 'react-router-dom';
9
9
  import { flattenToAppURL } from '@plone/volto/helpers';
10
10
  import { Nav, NavItem, NavLink } from 'design-react-kit';
11
11
  import { useHomePath } from 'design-comuni-plone-theme/helpers';
12
+ import { defineMessages, useIntl } from 'react-intl';
13
+
14
+ const messages = defineMessages({
15
+ parent_site_menu: {
16
+ id: 'parent_site_menu',
17
+ defaultMessage: 'Main site menu',
18
+ },
19
+ });
12
20
 
13
21
  const ParentSiteMenu = () => {
22
+ const intl = useIntl();
14
23
  const dropdownMenu = useSelector(
15
24
  (state) => state.dropdownMenuNavItems?.result,
16
25
  );
@@ -39,7 +48,11 @@ const ParentSiteMenu = () => {
39
48
  }
40
49
 
41
50
  return subsite && menu ? (
42
- <Nav vertical={false} className="parent-site-menu">
51
+ <Nav
52
+ vertical={false}
53
+ className="parent-site-menu"
54
+ aria-label={intl.formatMessage(messages.parent_site_menu)}
55
+ >
43
56
  {menu.items.map((navitem, id) => (
44
57
  <NavItem tag="li" key={id}>
45
58
  <NavLink
@@ -15,6 +15,10 @@ const messages = defineMessages({
15
15
  id: 'skiplink-footer',
16
16
  defaultMessage: 'Skip to footer',
17
17
  },
18
+ skiplinks_description: {
19
+ id: 'skiplinks-description',
20
+ defaultMessage: 'Skiplinks',
21
+ },
18
22
  });
19
23
 
20
24
  const SkipLinks = () => {
@@ -32,7 +36,11 @@ const SkipLinks = () => {
32
36
 
33
37
  return (
34
38
  <div className="public-ui">
35
- <Skiplink tag="div">
39
+ <Skiplink
40
+ tag="div"
41
+ role="complementary"
42
+ aria-label={intl.formatMessage(messages.skiplinks_description)}
43
+ >
36
44
  <SkiplinkItem href="#view" tag="a">
37
45
  {intl.formatMessage(messages.mainView)}
38
46
  </SkiplinkItem>
@@ -5,6 +5,7 @@
5
5
 
6
6
  import React, { createRef } from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import { defineMessages, useIntl } from 'react-intl';
8
9
 
9
10
  import {
10
11
  PageHeader,
@@ -25,6 +26,17 @@ import {
25
26
  useSideMenu,
26
27
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
27
28
 
29
+ const messages = defineMessages({
30
+ sideMenuIndex: {
31
+ id: 'sideMenuIndex',
32
+ defaultMessage: 'Indice della pagina',
33
+ },
34
+ bandoContent: {
35
+ id: 'bandoContent',
36
+ defaultMessage: 'Contenuto del Bando',
37
+ },
38
+ });
39
+
28
40
  export const BandoViewSectionsOrder = [
29
41
  { /* Testo */ component: BandoText },
30
42
  /* Responsabili */
@@ -46,6 +58,7 @@ export const BandoViewSectionsOrder = [
46
58
  */
47
59
  const BandoView = ({ content, location }) => {
48
60
  let documentBody = createRef();
61
+ const intl = useIntl();
49
62
  const { sideMenuElements, SideMenu } = useSideMenu(content, documentBody);
50
63
 
51
64
  return (
@@ -61,7 +74,10 @@ const BandoView = ({ content, location }) => {
61
74
  showbandostate={true}
62
75
  />
63
76
  <div className="row row-column-border border-light row-column-menu-left">
64
- <aside className="col-lg-4">
77
+ <aside
78
+ className="col-lg-4"
79
+ aria-label={intl.formatMessage(messages.sideMenuIndex)}
80
+ >
65
81
  {__CLIENT__ && (
66
82
  <SideMenu data={sideMenuElements} content_uid={content?.UID} />
67
83
  )}
@@ -70,6 +86,8 @@ const BandoView = ({ content, location }) => {
70
86
  ref={documentBody}
71
87
  id="main-content-section"
72
88
  className="col-lg-8 it-page-sections-container border-light"
89
+ role="region"
90
+ aria-label={intl.formatMessage(messages.bandoContent)}
73
91
  >
74
92
  {/* SEZIONI */}
75
93
  <ContentTypeViewSections
@@ -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
  };
@@ -56,6 +56,7 @@ const PageHeader = (props) => {
56
56
  } = props;
57
57
  const intl = useIntl();
58
58
  const Image = config.getComponent({ name: 'Image' }).component;
59
+ const subtitle = content.subtitle || content.sottotitolo;
59
60
  return (
60
61
  <div className="PageHeaderWrapper mb-4">
61
62
  <div className="row mb-2 mb-lg-0 page-header">
@@ -75,10 +76,8 @@ const PageHeader = (props) => {
75
76
  >
76
77
  {content.title}
77
78
  </h1>
78
- <p className="h2">
79
- {content.subtitle && `${content.subtitle}`}
80
- {content.sottotitolo && `${content.sottotitolo}`}
81
- </p>
79
+
80
+ {subtitle && <p className="h2">{subtitle}</p>}
82
81
 
83
82
  <PageHeaderEventDates content={content} />
84
83
 
@@ -3,6 +3,14 @@ import PropTypes from 'prop-types';
3
3
  import ItemInEvidence from 'design-comuni-plone-theme/components/ItaliaTheme/View/Commons/RelatedItemInEvidence/ItemInEvidence';
4
4
  import Arguments from 'design-comuni-plone-theme/components/ItaliaTheme/View/Commons/RelatedItemInEvidence/Arguments';
5
5
  import { Container, Row, Col } from 'design-react-kit';
6
+ import { defineMessages, useIntl } from 'react-intl';
7
+
8
+ const messages = defineMessages({
9
+ inEvidenceItems: {
10
+ id: 'inEvidenceItems',
11
+ defaultMessage: 'Contenuti in evidenza',
12
+ },
13
+ });
6
14
 
7
15
  /**
8
16
  * RelatedItems view component class.
@@ -11,9 +19,14 @@ import { Container, Row, Col } from 'design-react-kit';
11
19
  * @returns {string} Markup of the component.
12
20
  */
13
21
  const RelatedItemInEvidence = ({ content }) => {
22
+ const intl = useIntl();
14
23
  return (
15
24
  content?.correlato_in_evidenza?.length > 0 && (
16
- <section id="correlato-in-evidenza">
25
+ <section
26
+ id="correlato-in-evidenza"
27
+ role="complementary"
28
+ aria-label={intl.formatMessage(messages.inEvidenceItems)}
29
+ >
17
30
  <section className="section bg-primary">
18
31
  <div className="section-content">
19
32
  <Container>
@@ -71,7 +71,11 @@ const RelatedItems = ({
71
71
  }
72
72
 
73
73
  return related?.length > 0 || children ? (
74
- <section id="contenuti-correlati">
74
+ <section
75
+ id="contenuti-correlati"
76
+ role="complementary"
77
+ aria-label={intl.formatMessage(messages.related_items)}
78
+ >
75
79
  <section className="section section-muted section-inset-shadow">
76
80
  <div className="section-content">
77
81
  <Container>
@@ -24,6 +24,10 @@ const messages = defineMessages({
24
24
  id: 'Contenuto',
25
25
  defaultMessage: 'Contenuto',
26
26
  },
27
+ sideMenuNavigation: {
28
+ id: 'sideMenuNavigation',
29
+ defaultMessage: 'Navigazione della pagina',
30
+ },
27
31
  });
28
32
 
29
33
  const extractHeaders = (elements, intl) => {
@@ -151,7 +155,10 @@ const SideMenu = ({ data, content_uid }) => {
151
155
 
152
156
  return headers?.length > 0 ? (
153
157
  <div className="sticky-wrapper navbar-wrapper page-side-menu">
154
- <nav className="navbar it-navscroll-wrapper navbar-expand-lg">
158
+ <nav
159
+ className="navbar it-navscroll-wrapper navbar-expand-lg"
160
+ aria-label={intl.formatMessage(messages.sideMenuNavigation)}
161
+ >
155
162
  <div className="menu-wrapper">
156
163
  <div className="link-list-wrapper menu-link-list">
157
164
  <div className="accordion-wrapper">
@@ -162,6 +169,7 @@ const SideMenu = ({ data, content_uid }) => {
162
169
  setIsNavOpen(!isNavOpen);
163
170
  }}
164
171
  aria-controls="side-menu-body"
172
+ aria-expanded={isNavOpen}
165
173
  >
166
174
  <h2 className="h3">{intl.formatMessage(messages.index)}</h2>
167
175
  </AccordionHeader>
@@ -171,11 +179,7 @@ const SideMenu = ({ data, content_uid }) => {
171
179
  role="progressbar"
172
180
  />
173
181
  </div>
174
- <AccordionBody
175
- active={isNavOpen}
176
- id="side-menu-body"
177
- role="region"
178
- >
182
+ <AccordionBody active={isNavOpen} id="side-menu-body">
179
183
  <ul className="link-list" data-element="page-index">
180
184
  {headers.map((item, i) => {
181
185
  return (
@@ -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
  ))}
@@ -25,6 +25,19 @@ import {
25
25
  useSideMenu,
26
26
  } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
27
27
 
28
+ import { defineMessages, useIntl } from 'react-intl';
29
+
30
+ const messages = defineMessages({
31
+ sideMenuIndex: {
32
+ id: 'sideMenuIndex',
33
+ defaultMessage: 'Indice della pagina',
34
+ },
35
+ documentContent: {
36
+ id: 'documentContent',
37
+ defaultMessage: 'Contenuto del documento',
38
+ },
39
+ });
40
+
28
41
  export const DocumentoViewSectionsOrder = [
29
42
  {
30
43
  /* HEADER IMAGE */
@@ -48,6 +61,7 @@ export const DocumentoViewSectionsOrder = [
48
61
  */
49
62
  const DocumentoView = ({ content, location }) => {
50
63
  let documentBody = createRef();
64
+ const intl = useIntl();
51
65
  const { sideMenuElements, SideMenu } = useSideMenu(content, documentBody);
52
66
 
53
67
  //const userLogged = useSelector((state) => state.userSession);
@@ -66,7 +80,10 @@ const DocumentoView = ({ content, location }) => {
66
80
  <ContentImage content={content} position="afterHeader" />
67
81
 
68
82
  <div className="row row-column-border border-light row-column-menu-left">
69
- <aside className="col-lg-4">
83
+ <aside
84
+ className="col-lg-4"
85
+ aria-label={intl.formatMessage(messages.sideMenuIndex)}
86
+ >
70
87
  {__CLIENT__ && (
71
88
  <SideMenu data={sideMenuElements} content_uid={content?.UID} />
72
89
  )}
@@ -75,6 +92,8 @@ const DocumentoView = ({ content, location }) => {
75
92
  ref={documentBody}
76
93
  id="main-content-section"
77
94
  className="col-lg-8 it-page-sections-container border-light"
95
+ role="region"
96
+ aria-label={intl.formatMessage(messages.documentContent)}
78
97
  >
79
98
  {/* SEZIONI */}
80
99
  <ContentTypeViewSections
@@ -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;