- {data.title &&
{data?.title}
}
- {data.subtitle &&
{data?.subtitle}
}
- {data.description &&
{data?.description}
}
- {data?.hasButton === true && (
-
- {data?.buttonTitle}
-
- )}
+
+
+ {isEditMode &&
}
+
+
+ {data.title &&
{data?.title}
}
+ {data.subtitle && {data?.subtitle}
}
+ {data.description && {data?.description}
}
+ {data?.hasButton === true && (
+
+ {data?.buttonTitle}
+
+ )}
+
+
+
+
+
+
{data?.greenText}
+
+
+ {data?.location}
+
diff --git a/src/components/Blocks/CclHomeBgImageBlock/CclHomeBgImageSchema.js b/src/components/Blocks/CclHomeBgImageBlock/CclHomeBgImageSchema.js
index 3377a81de..664d6579b 100644
--- a/src/components/Blocks/CclHomeBgImageBlock/CclHomeBgImageSchema.js
+++ b/src/components/Blocks/CclHomeBgImageBlock/CclHomeBgImageSchema.js
@@ -19,7 +19,15 @@ export const HomeBgImageSchema = (config, hasButton) => {
{
id: 'default',
title: 'Default',
- fields: ['title', 'subtitle', 'description', 'variation', 'hasButton'],
+ fields: [
+ 'title',
+ 'subtitle',
+ 'description',
+ 'variation',
+ 'greenText',
+ 'location',
+ 'hasButton',
+ ],
},
...hasButtonFieldset,
],
@@ -49,6 +57,16 @@ export const HomeBgImageSchema = (config, hasButton) => {
type: 'array',
choices: [...variations],
},
+ greenText: {
+ title: 'Left text',
+ description: 'Green bg left side text',
+ type: 'string',
+ },
+ location: {
+ title: 'Location',
+ description: 'Green bg location',
+ type: 'string',
+ },
buttonTitle: {
title: 'Title',
description: 'Add button text',
diff --git a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclCarouselView.jsx b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclCarouselView.jsx
new file mode 100644
index 000000000..e160c6c05
--- /dev/null
+++ b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclCarouselView.jsx
@@ -0,0 +1,103 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { compose } from 'redux';
+import { withRouter } from 'react-router';
+import loadable from '@loadable/component';
+import { RenderBlocks } from '@plone/volto/components';
+import { withScrollToTarget } from '@eeacms/volto-tabs-block/hocs';
+import './custom.less';
+
+const Slider = loadable(() => import('react-slick'));
+
+const View = (props) => {
+ const slider = React.useRef(null);
+ const [hashlinkOnMount, setHashlinkOnMount] = React.useState(false);
+ const {
+ activeTab = null,
+ data = {},
+ hashlink = {},
+ metadata = {},
+ tabsList = [],
+ tabs = {},
+ setActiveTab = () => {},
+ } = props;
+ const activeTabIndex = tabsList.indexOf(activeTab);
+
+ const settings = {
+ dots: true,
+ infinite: true,
+ speed: 1500,
+ fade: true,
+ cssEase: 'linear',
+ autoplay: true,
+ autoplaySpeed: 3000,
+ swipe: true,
+ slidesToShow: 1,
+ slidesToScroll: 1,
+ touchMove: true,
+ beforeChange: (oldIndex, index) => {
+ setActiveTab(tabsList[index]);
+ },
+ };
+
+ React.useEffect(() => {
+ const urlHash = props.location.hash.substring(1) || '';
+ if (
+ hashlink.counter > 0 ||
+ (hashlink.counter === 0 && urlHash && !hashlinkOnMount)
+ ) {
+ const id = hashlink.hash || urlHash || '';
+ const index = tabsList.indexOf(id);
+ const parentId = data.id || props.id;
+ const parent = document.getElementById(parentId);
+ // TODO: Find the best way to add offset relative to header
+ // The header can be static on mobile and relative on > mobile
+ // const headerWrapper = document.querySelector('.header-wrapper');
+ // const offsetHeight = headerWrapper?.offsetHeight || 0;
+ const offsetHeight = 0;
+ if (id !== parentId && index > -1 && parent) {
+ if (activeTabIndex !== index) {
+ slider.current.slickGoTo(index);
+ }
+ props.scrollToTarget(parent, offsetHeight);
+ } else if (id === parentId && parent) {
+ props.scrollToTarget(parent, offsetHeight);
+ }
+ }
+ if (!hashlinkOnMount) {
+ setHashlinkOnMount(true);
+ }
+ /* eslint-disable-next-line */
+ }, [hashlink.counter]);
+
+ const panes = tabsList.map((tab, index) => {
+ return {
+ id: tab,
+ renderItem: (
+
+ ),
+ };
+ });
+
+ return (
+ <>
+
+ {panes.length ? panes.map((pane) => pane.renderItem) : ''}
+
+ >
+ );
+};
+
+export default compose(
+ connect((state) => {
+ return {
+ hashlink: state.hashlink,
+ };
+ }),
+ withScrollToTarget,
+)(withRouter(View));
diff --git a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclTabsView.jsx b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclTabsView.jsx
index 4e7389795..eb37f4763 100644
--- a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclTabsView.jsx
+++ b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclTabsView.jsx
@@ -99,8 +99,8 @@ const CclTabsView = (props) => {
aria-controls={title || defaultTitle}
aria-selected={tab === activeTab}
active={(tab === activeTab).toString()}
- /* classname hontan estiloa aldatu behar da aukeratutako tab-a urdin ikusteko */
- className={cx('tab', tab !== activeTab && 'tab-selected')}
+ /* classname hontan estiloa aldatu behar bada "===" "!==" gatik aldatu */
+ className={cx('tab', tab === activeTab && 'tab-selected')}
onClick={() => {
if (activeTab !== tab) {
setActiveTab(tab);
diff --git a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalFaqTabsView.jsx b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalFaqTabsView.jsx
index 6667ad8d1..0d1d53900 100644
--- a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalFaqTabsView.jsx
+++ b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalFaqTabsView.jsx
@@ -6,6 +6,7 @@ import { RenderBlocks } from '@plone/volto/components';
import { withScrollToTarget } from '@eeacms/volto-tabs-block/hocs';
import './fontawesome';
import cx from 'classnames';
+import './custom.less';
const CclVerticalFaqTabsView = (props) => {
const [hashlinkOnMount, setHashlinkOnMount] = React.useState(false);
diff --git a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/custom.less b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/custom.less
new file mode 100644
index 000000000..4ffe93556
--- /dev/null
+++ b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/custom.less
@@ -0,0 +1,15 @@
+.tabs-block.CCLVerticalFaqTabs > div.styled {
+ display: block !important;
+}
+
+div.tabs-block.CCLCarousel {
+ div & {
+ position: relative !important;
+ right: 50% !important;
+ left: 50% !important;
+ width: 100vw !important;
+ max-width: initial !important;
+ margin-right: -50vw !important;
+ margin-left: -50vw !important;
+ }
+}
diff --git a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/index.js b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/index.js
index 01f9ea950..65f4fbbec 100644
--- a/src/components/Blocks/CustomTemplates/VoltoTabsBlock/index.js
+++ b/src/components/Blocks/CustomTemplates/VoltoTabsBlock/index.js
@@ -1,5 +1,11 @@
import CclTabsView from './CclTabsView';
import CclVerticalTabsView from './CclVerticalTabsView';
import CclVerticalFaqTabsView from './CclVerticalFaqTabsView';
+import CclCarouselView from './CclCarouselView';
-export { CclTabsView, CclVerticalTabsView, CclVerticalFaqTabsView };
+export {
+ CclTabsView,
+ CclVerticalTabsView,
+ CclVerticalFaqTabsView,
+ CclCarouselView,
+};
diff --git a/src/components/Blocks/customBlocks.js b/src/components/Blocks/customBlocks.js
index a86d7621e..9a15ef386 100644
--- a/src/components/Blocks/customBlocks.js
+++ b/src/components/Blocks/customBlocks.js
@@ -34,6 +34,7 @@ import {
CclTabsView,
CclVerticalTabsView,
CclVerticalFaqTabsView,
+ CclCarouselView,
} from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoTabsBlock';
import {
@@ -61,6 +62,9 @@ import CclUseCaseListEdit from '@eeacms/volto-clms-theme/components/Blocks/CclUs
import CclTechnicalLibrariesListView from '@eeacms/volto-clms-theme/components/Blocks/CclTechnicalLibrariesList/CclTechnicalLibrariesListView';
import CclTechnicalLibrariesListEdit from '@eeacms/volto-clms-theme/components/Blocks/CclTechnicalLibrariesList/CclTechnicalLibrariesListEdit';
+import upSVG from '@plone/volto/icons/up-key.svg';
+import downSVG from '@plone/volto/icons/down-key.svg';
+
export const customGroupBlocksOrder = {
id: 'ccl_blocks',
title: 'Ccl Blocks',
@@ -106,6 +110,12 @@ const customBlocks = (config) => ({
view: CclVerticalFaqTabsView,
schema: defaultSchema,
},
+ CCLCarousel: {
+ title: 'CCL Carousel (Copernicus Style Guide)',
+ edit: DefaultEdit,
+ view: CclCarouselView,
+ schema: defaultSchema,
+ },
...(config.blocks.blocksConfig[TABS_BLOCK]?.templates || {}),
},
},
@@ -164,6 +174,13 @@ const customBlocks = (config) => ({
},
],
},
+ accordion: {
+ ...config.blocks.blocksConfig.accordion,
+ titleIcons: {
+ closed: { leftPosition: downSVG, rightPosition: downSVG },
+ opened: { leftPosition: upSVG, rightPosition: upSVG },
+ },
+ },
contextNavigation: {
id: 'contextNavigation', // The name (id) of the block
title: 'Context Navigation', // The display name of the block
diff --git a/src/components/CLMSEventView/CLMSEventView.jsx b/src/components/CLMSEventView/CLMSEventView.jsx
index 817821da5..2d09c10e7 100644
--- a/src/components/CLMSEventView/CLMSEventView.jsx
+++ b/src/components/CLMSEventView/CLMSEventView.jsx
@@ -1,4 +1,5 @@
import React from 'react';
+import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
export const CLMSEventView = (props) => {
@@ -19,11 +20,25 @@ export const CLMSEventView = (props) => {
}
alt={content?.image ? content?.image?.filename : 'Placeholder'}
/>
- {/*
Lorem ipsum dolor sit amet */}
+
{content?.description}
+
+
+
+ {new Date(content?.effective).toLocaleDateString()} -{' '}
+ {new Date(content?.end).toLocaleDateString()}
+
+
+
+
+
{content?.location}
+
+
+ {'Register here'}
+