From 235b16e3cfffb11c72cc07c9b635e1202b094ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katja=20Su=CC=88ss?= Date: Wed, 2 Oct 2024 18:05:49 +0200 Subject: [PATCH] Relations: Show related speakers on Talk and Listing --- .../src/components/Views/Talk.jsx | 90 ++++++++++--------- .../variations/TalkListingBlockVariation.jsx | 10 ++- 2 files changed, 54 insertions(+), 46 deletions(-) diff --git a/packages/volto-ploneconf/src/components/Views/Talk.jsx b/packages/volto-ploneconf/src/components/Views/Talk.jsx index ec02b25..8239311 100644 --- a/packages/volto-ploneconf/src/components/Views/Talk.jsx +++ b/packages/volto-ploneconf/src/components/Views/Talk.jsx @@ -1,12 +1,16 @@ +import { isEmpty } from 'lodash'; import { Container as SemanticContainer, + Grid, Header, Image, Label, Segment, } from 'semantic-ui-react'; import { flattenToAppURL } from '@plone/volto/helpers'; +import { Component, UniversalLink } from '@plone/volto/components'; import { When } from '@plone/volto/components/theme/View/EventDatesInfo'; +import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg'; import config from '@plone/volto/registry'; const TalkView = (props) => { @@ -28,6 +32,13 @@ const TalkView = (props) => {

{content.description}

)} + {content.image?.scales && ( + {content.title} + )} {content.start && !content.hide_date && ( <>
@@ -67,50 +78,41 @@ const TalkView = (props) => {
- {content.speaker &&
{content.speaker}
} - {content.website ? ( -

- {content.company || content.website} -

- ) : ( -

{content.company}

- )} - {content.email && ( -

- Email: {content.email} -

- )} - {content.twitter && ( -

- X:{' '} - - {content.twitter.startsWith('@') - ? content.twitter - : '@' + content.twitter} - -

- )} - {content.github && ( -

- Github:{' '} - - {content.github} - -

- )} - {content.speaker} - {content.speaker_biography && ( -
+
Speaker
+ {content.speaker?.length > 0 && ( + + + {content.speaker.map((el) => ( + + + {isEmpty(el.image_scales) ? ( + {el.title} + ) : ( + + )} +
{el.title}
+
+
+ ))} +
+
)} diff --git a/packages/volto-ploneconf/src/components/variations/TalkListingBlockVariation.jsx b/packages/volto-ploneconf/src/components/variations/TalkListingBlockVariation.jsx index 4919bf2..f5aaf24 100644 --- a/packages/volto-ploneconf/src/components/variations/TalkListingBlockVariation.jsx +++ b/packages/volto-ploneconf/src/components/variations/TalkListingBlockVariation.jsx @@ -38,7 +38,11 @@ const TalkListingBlockVariation = ({
- +

{item.title || item.id}

-

{item.speaker}

+ {item.speaker?.length > 0 && ( +

{item.speaker.map((el) => el.title).join(', ')}

+ )}

{item.room && ( <>