From b2ceb27435f12a4992e348bff034ca9a187a2f28 Mon Sep 17 00:00:00 2001 From: Wagner Trezub <60133113+Wagner3UB@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:35:50 +0200 Subject: [PATCH] feat: added option to display caption in VideoGallery block (#747) * fix: sidebar changed to add the video caption * fix: added caption for videos * fix: added class figure-caption to the video caption * chore: release log * chore: release.md * fix: removed unnecessary code * fix: removed more unnecessary code * fix: removed unnecessary code Co-authored-by: Giulia Ghisini <51911425+giuliaghisini@users.noreply.github.com> --------- Co-authored-by: Giulia Ghisini <51911425+giuliaghisini@users.noreply.github.com> --- RELEASE.md | 5 +++- locales/de/LC_MESSAGES/volto.po | 12 ++++----- locales/en/LC_MESSAGES/volto.po | 12 ++++----- locales/es/LC_MESSAGES/volto.po | 12 ++++----- locales/fr/LC_MESSAGES/volto.po | 12 ++++----- locales/it/LC_MESSAGES/volto.po | 14 +++++------ locales/volto.pot | 13 +++++----- .../Blocks/VideoGallery/Block/EditBlock.jsx | 7 ++++-- .../Blocks/VideoGallery/Block/ViewBlock.jsx | 12 +++++++-- .../ItaliaTheme/Blocks/VideoGallery/Edit.jsx | 1 + .../Blocks/VideoGallery/Sidebar.jsx | 25 ++++++++++++------- .../ItaliaTheme/Blocks/VideoGallery/View.jsx | 5 +++- 12 files changed, 78 insertions(+), 52 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index d87db1fe4..2c2cc8e5a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -30,11 +30,14 @@ - ... --> -## Versione 7.30.5 (02/09/2024) +## Versione 7.30.5 (27/08/2024) ### Migliorie +- Aggiunta una opzione scegliere se mostrare la didascalia nel blocco Video Gallery - Aggiunto la data di modifica nei documenti allegati del CT Bando +odifica nei documenti allegati del CT Bando + ## Versione 7.30.4 (26/08/2024) diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index deb4f70f3..09d96c5a8 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -2051,15 +2051,10 @@ msgid "gallery_close_preview" msgstr "" #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Titolo del video +# defaultMessage: Didascalia del video msgid "gallery_video_title" msgstr "" -#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Non viene mostrato. Serve al redattore per identificare meglio il video all'interno della gallery. -msgid "gallery_video_title_description" -msgstr "" - #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar # defaultMessage: Video URL msgid "gallery_video_url" @@ -3277,6 +3272,11 @@ msgstr "" msgid "share" msgstr "" +#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar +# defaultMessage: Mostra didascalie +msgid "showVideoCaption" +msgstr "" + #: config/Blocks/ListingOptions/bandiInEvidenceTemplate # defaultMessage: Mostra la data di ultima modifica msgid "show_data_ultima_modifica" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index fa8539efe..b9ddbf17b 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -2036,15 +2036,10 @@ msgid "gallery_close_preview" msgstr "Close preview" #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Titolo del video +# defaultMessage: Didascalia del video msgid "gallery_video_title" msgstr "" -#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Non viene mostrato. Serve al redattore per identificare meglio il video all'interno della gallery. -msgid "gallery_video_title_description" -msgstr "" - #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar # defaultMessage: Video URL msgid "gallery_video_url" @@ -3262,6 +3257,11 @@ msgstr "Arrange on 4 columns" msgid "share" msgstr "Share" +#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar +# defaultMessage: Mostra didascalie +msgid "showVideoCaption" +msgstr "" + #: config/Blocks/ListingOptions/bandiInEvidenceTemplate # defaultMessage: Mostra la data di ultima modifica msgid "show_data_ultima_modifica" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 3255df066..4d489f8d7 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -2045,15 +2045,10 @@ msgid "gallery_close_preview" msgstr "Cerrar vista previa" #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Titolo del video +# defaultMessage: Didascalia del video msgid "gallery_video_title" msgstr "Título del vídeo" -#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Non viene mostrato. Serve al redattore per identificare meglio il video all'interno della gallery. -msgid "gallery_video_title_description" -msgstr "No se muestra. El editor lo utiliza para identificar mejor el vídeo dentro de la galería." - #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar # defaultMessage: Video URL msgid "gallery_video_url" @@ -3271,6 +3266,11 @@ msgstr "Organizar en 4 columnas" msgid "share" msgstr "Compartir" +#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar +# defaultMessage: Mostra didascalie +msgid "showVideoCaption" +msgstr "" + #: config/Blocks/ListingOptions/bandiInEvidenceTemplate # defaultMessage: Mostra la data di ultima modifica msgid "show_data_ultima_modifica" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index 6ec03772a..a6e9758e9 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -2053,15 +2053,10 @@ msgid "gallery_close_preview" msgstr "Fermer l'aperçu de l'image" #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Titolo del video +# defaultMessage: Didascalia del video msgid "gallery_video_title" msgstr "" -#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Non viene mostrato. Serve al redattore per identificare meglio il video all'interno della gallery. -msgid "gallery_video_title_description" -msgstr "" - #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar # defaultMessage: Video URL msgid "gallery_video_url" @@ -3279,6 +3274,11 @@ msgstr "Disposer sur 4 colonnes" msgid "share" msgstr "Partager" +#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar +# defaultMessage: Mostra didascalie +msgid "showVideoCaption" +msgstr "" + #: config/Blocks/ListingOptions/bandiInEvidenceTemplate # defaultMessage: Mostra la data di ultima modifica msgid "show_data_ultima_modifica" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index 8a20e3249..9b6992b3b 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -2036,14 +2036,9 @@ msgid "gallery_close_preview" msgstr "Chiudi l'anteprima" #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Titolo del video +# defaultMessage: Didascalia del video msgid "gallery_video_title" -msgstr "Titolo del video" - -#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Non viene mostrato. Serve al redattore per identificare meglio il video all'interno della gallery. -msgid "gallery_video_title_description" -msgstr "Non viene mostrato. Serve al redattore per identificare meglio il video all'interno della gallery." +msgstr "Didascalia del video" #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar # defaultMessage: Video URL @@ -3262,6 +3257,11 @@ msgstr "Disponi su 4 colonne" msgid "share" msgstr "Condividi" +#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar +# defaultMessage: Mostra didascalie +msgid "showVideoCaption" +msgstr "" + #: config/Blocks/ListingOptions/bandiInEvidenceTemplate # defaultMessage: Mostra la data di ultima modifica msgid "show_data_ultima_modifica" diff --git a/locales/volto.pot b/locales/volto.pot index caa451fe2..24c3d80c9 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,6 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" + "POT-Creation-Date: 2024-08-28T08:55:19.173Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" @@ -2038,15 +2039,10 @@ msgid "gallery_close_preview" msgstr "" #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Titolo del video +# defaultMessage: Didascalia del video msgid "gallery_video_title" msgstr "" -#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar -# defaultMessage: Non viene mostrato. Serve al redattore per identificare meglio il video all'interno della gallery. -msgid "gallery_video_title_description" -msgstr "" - #: components/ItaliaTheme/Blocks/VideoGallery/Sidebar # defaultMessage: Video URL msgid "gallery_video_url" @@ -3264,6 +3260,11 @@ msgstr "" msgid "share" msgstr "" +#: components/ItaliaTheme/Blocks/VideoGallery/Sidebar +# defaultMessage: Mostra didascalie +msgid "showVideoCaption" +msgstr "" + #: config/Blocks/ListingOptions/bandiInEvidenceTemplate # defaultMessage: Mostra la data di ultima modifica msgid "show_data_ultima_modifica" diff --git a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx index cf2004a0e..0f26d0e49 100644 --- a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx +++ b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx @@ -32,10 +32,13 @@ class EditBlock extends SubblockEdit { if (__SERVER__) { return
; } - return ( - + {(!this.props.data?.url || this.props.data?.url.length === 0) && (
{this.props.intl.formatMessage(messages.noVideoUrl)}
)} diff --git a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx index 49d34e8e9..ae47d8ea6 100644 --- a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx +++ b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx @@ -32,7 +32,12 @@ const messages = defineMessages({ * @class ViewBlock * @extends Component */ -const ViewBlock = ({ data, index, isEditMode = false }) => { +const ViewBlock = ({ + data, + showVideoCaption = false, + index, + isEditMode = false, +}) => { const intl = useIntl(); let placeholder = data.preview_image ? isInternalURL(data.preview_image) @@ -134,10 +139,13 @@ const ViewBlock = ({ data, index, isEditMode = false }) => { type="video/mp4" /> ) : data.allowExternals ? ( - + ) : (
)} + {showVideoCaption && ( +

{data.title}

+ )} )} diff --git a/src/components/ItaliaTheme/Blocks/VideoGallery/Edit.jsx b/src/components/ItaliaTheme/Blocks/VideoGallery/Edit.jsx index d60343a4a..a36ac75c7 100644 --- a/src/components/ItaliaTheme/Blocks/VideoGallery/Edit.jsx +++ b/src/components/ItaliaTheme/Blocks/VideoGallery/Edit.jsx @@ -51,6 +51,7 @@ class Edit extends SubblocksEdit { {this.state.subblocks.map((subblock, subindex) => (
+ { + onChangeBlock(block, { + ...data, + showVideoCaption: value, + }); + }} + /> {data.subblocks && @@ -139,9 +149,6 @@ const Sidebar = ({ { onChangeSubBlock(index, { diff --git a/src/components/ItaliaTheme/Blocks/VideoGallery/View.jsx b/src/components/ItaliaTheme/Blocks/VideoGallery/View.jsx index effd0cc4c..d3c6d375a 100644 --- a/src/components/ItaliaTheme/Blocks/VideoGallery/View.jsx +++ b/src/components/ItaliaTheme/Blocks/VideoGallery/View.jsx @@ -19,7 +19,10 @@ const View = ({ data, block }) => { {data.subblocks.map((subblock, subindex) => (
- +
))}