@eeacms/volto-n2k 0.1.1
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.
- package/.coverage.babel.config.js +9 -0
- package/.release-it.json +17 -0
- package/CHANGELOG.md +155 -0
- package/DEVELOP.md +53 -0
- package/Jenkinsfile +209 -0
- package/LICENSE.md +9 -0
- package/README.md +62 -0
- package/bootstrap +41 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/integration/block-basics.js +32 -0
- package/cypress/plugins/index.js +26 -0
- package/cypress/support/commands.js +315 -0
- package/cypress/support/index.js +53 -0
- package/cypress.json +12 -0
- package/jest-addon.config.js +36 -0
- package/package.json +57 -0
- package/src/actions.js +20 -0
- package/src/components/index.js +3 -0
- package/src/components/manage/Blocks/BodyClass/Edit.jsx +29 -0
- package/src/components/manage/Blocks/BodyClass/View.jsx +13 -0
- package/src/components/manage/Blocks/BodyClass/index.js +24 -0
- package/src/components/manage/Blocks/BodyClass/schema.js +19 -0
- package/src/components/manage/Blocks/BubbleChart/BubbleChart.jsx +101 -0
- package/src/components/manage/Blocks/BubbleChart/Chart.jsx +67 -0
- package/src/components/manage/Blocks/BubbleChart/ChartContext.jsx +3 -0
- package/src/components/manage/Blocks/BubbleChart/View.jsx +63 -0
- package/src/components/manage/Blocks/BubbleChart/index.js +17 -0
- package/src/components/manage/Blocks/BubbleChart/schema.js +124 -0
- package/src/components/manage/Blocks/BubbleChart/style.less +12 -0
- package/src/components/manage/Blocks/CarouselHorizontal/HorizontalView.jsx +221 -0
- package/src/components/manage/Blocks/CarouselHorizontal/index.js +19 -0
- package/src/components/manage/Blocks/CarouselHorizontal/schema.js +32 -0
- package/src/components/manage/Blocks/CddaShape/View.jsx +109 -0
- package/src/components/manage/Blocks/CddaShape/index.js +23 -0
- package/src/components/manage/Blocks/CddaShape/schema.js +19 -0
- package/src/components/manage/Blocks/CddaShape/style.less +14 -0
- package/src/components/manage/Blocks/ContactBlock/View.jsx +56 -0
- package/src/components/manage/Blocks/ContactBlock/icons/domain.svg +1 -0
- package/src/components/manage/Blocks/ContactBlock/icons/email.svg +1 -0
- package/src/components/manage/Blocks/ContactBlock/icons/location.svg +1 -0
- package/src/components/manage/Blocks/ContactBlock/index.js +17 -0
- package/src/components/manage/Blocks/ContactBlock/schema.js +57 -0
- package/src/components/manage/Blocks/ContactBlock/styles.less +31 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/Pie.jsx +125 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/View.jsx +80 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/index.js +17 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/schema.js +75 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/style.less +80 -0
- package/src/components/manage/Blocks/ExploreHabitats/Edit.jsx +29 -0
- package/src/components/manage/Blocks/ExploreHabitats/View.jsx +177 -0
- package/src/components/manage/Blocks/ExploreHabitats/index.js +24 -0
- package/src/components/manage/Blocks/ExploreHabitats/schema.js +15 -0
- package/src/components/manage/Blocks/ExploreHabitats/style.less +15 -0
- package/src/components/manage/Blocks/ExploreSites/Edit.jsx +29 -0
- package/src/components/manage/Blocks/ExploreSites/View.jsx +175 -0
- package/src/components/manage/Blocks/ExploreSites/index.js +24 -0
- package/src/components/manage/Blocks/ExploreSites/schema.js +15 -0
- package/src/components/manage/Blocks/ExploreSites/style.less +15 -0
- package/src/components/manage/Blocks/ExploreSpecies/Edit.jsx +29 -0
- package/src/components/manage/Blocks/ExploreSpecies/View.jsx +177 -0
- package/src/components/manage/Blocks/ExploreSpecies/index.js +24 -0
- package/src/components/manage/Blocks/ExploreSpecies/schema.js +15 -0
- package/src/components/manage/Blocks/ExploreSpecies/style.less +15 -0
- package/src/components/manage/Blocks/HabitatClassification/View.jsx +30 -0
- package/src/components/manage/Blocks/HabitatClassification/index.js +17 -0
- package/src/components/manage/Blocks/HabitatClassification/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatClassification/style.less +3 -0
- package/src/components/manage/Blocks/HabitatDistribution/View.jsx +97 -0
- package/src/components/manage/Blocks/HabitatDistribution/index.js +23 -0
- package/src/components/manage/Blocks/HabitatDistribution/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatDistribution/style.less +5 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/View.jsx +97 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/index.js +23 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/style.less +5 -0
- package/src/components/manage/Blocks/HabitatsBanner/View.jsx +39 -0
- package/src/components/manage/Blocks/HabitatsBanner/index.js +17 -0
- package/src/components/manage/Blocks/HabitatsBanner/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatsBanner/style.less +49 -0
- package/src/components/manage/Blocks/ImageText/Edit.jsx +98 -0
- package/src/components/manage/Blocks/ImageText/View.jsx +66 -0
- package/src/components/manage/Blocks/ImageText/index.js +24 -0
- package/src/components/manage/Blocks/ImageText/schema.js +69 -0
- package/src/components/manage/Blocks/ImageText/styles.less +87 -0
- package/src/components/manage/Blocks/Landing/DefalutView.jsx +83 -0
- package/src/components/manage/Blocks/Landing/Edit.jsx +219 -0
- package/src/components/manage/Blocks/Landing/EditBlockWrapper.jsx +161 -0
- package/src/components/manage/Blocks/Landing/View.jsx +65 -0
- package/src/components/manage/Blocks/Landing/images/background.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/coasts_and_seas.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/forests.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/grasslands.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/hiker.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/islands.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/mountains.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/natura2000.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/natura2000_square.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/peatlands.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/people_and_nature.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/rivers.webp +0 -0
- package/src/components/manage/Blocks/Landing/index.js +104 -0
- package/src/components/manage/Blocks/Landing/schema.js +62 -0
- package/src/components/manage/Blocks/Landing/style.less +174 -0
- package/src/components/manage/Blocks/List/View.jsx +37 -0
- package/src/components/manage/Blocks/List/index.js +17 -0
- package/src/components/manage/Blocks/List/schema.js +49 -0
- package/src/components/manage/Blocks/List/style.less +12 -0
- package/src/components/manage/Blocks/NavigationAnchors/Edit.jsx +33 -0
- package/src/components/manage/Blocks/NavigationAnchors/View.jsx +132 -0
- package/src/components/manage/Blocks/NavigationAnchors/assets/external.png +0 -0
- package/src/components/manage/Blocks/NavigationAnchors/index.js +23 -0
- package/src/components/manage/Blocks/NavigationAnchors/schema.js +76 -0
- package/src/components/manage/Blocks/NavigationAnchors/styles.less +104 -0
- package/src/components/manage/Blocks/SimpleDataTable/index.js +16 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/View.jsx +178 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/index.js +4 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/schema.js +56 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/style.less +54 -0
- package/src/components/manage/Blocks/SiteBanner/View.jsx +148 -0
- package/src/components/manage/Blocks/SiteBanner/index.js +17 -0
- package/src/components/manage/Blocks/SiteBanner/schema.js +19 -0
- package/src/components/manage/Blocks/SiteBanner/style.less +106 -0
- package/src/components/manage/Blocks/SiteHabitatsList/View.jsx +89 -0
- package/src/components/manage/Blocks/SiteHabitatsList/index.js +17 -0
- package/src/components/manage/Blocks/SiteHabitatsList/schema.js +19 -0
- package/src/components/manage/Blocks/SiteHabitatsList/style.less +70 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/View.jsx +47 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/images/background.webp +0 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/index.js +17 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/schema.js +19 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/style.less +90 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/View.jsx +55 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/images/background.webp +0 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/index.js +17 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/schema.js +19 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/style.less +90 -0
- package/src/components/manage/Blocks/SiteShape/View.jsx +107 -0
- package/src/components/manage/Blocks/SiteShape/index.js +23 -0
- package/src/components/manage/Blocks/SiteShape/schema.js +19 -0
- package/src/components/manage/Blocks/SiteShape/style.less +15 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/SortBy.jsx +52 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/SpeciesGroups.jsx +43 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/View.jsx +200 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/index.js +4 -0
- package/src/components/manage/Blocks/SiteSpeciesList/View.jsx +253 -0
- package/src/components/manage/Blocks/SiteSpeciesList/index.js +17 -0
- package/src/components/manage/Blocks/SiteSpeciesList/schema.js +19 -0
- package/src/components/manage/Blocks/SiteSpeciesList/style.less +264 -0
- package/src/components/manage/Blocks/SiteSpeciesList/utils.js +33 -0
- package/src/components/manage/Blocks/SlateLink/render.jsx +77 -0
- package/src/components/manage/Blocks/SlateLink/styles.less +22 -0
- package/src/components/manage/Blocks/SlateSVG/constants.js +1 -0
- package/src/components/manage/Blocks/SlateSVG/extensions.js +11 -0
- package/src/components/manage/Blocks/SlateSVG/index.js +47 -0
- package/src/components/manage/Blocks/SlateSVG/render.jsx +42 -0
- package/src/components/manage/Blocks/SlateSVG/schema.js +12 -0
- package/src/components/manage/Blocks/SlateSVG/styles.less +6 -0
- package/src/components/manage/Blocks/SpeciesBanner/View.jsx +109 -0
- package/src/components/manage/Blocks/SpeciesBanner/index.js +17 -0
- package/src/components/manage/Blocks/SpeciesBanner/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesBanner/style.less +115 -0
- package/src/components/manage/Blocks/SpeciesClassification/View.jsx +19 -0
- package/src/components/manage/Blocks/SpeciesClassification/index.js +17 -0
- package/src/components/manage/Blocks/SpeciesClassification/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesClassification/style.less +3 -0
- package/src/components/manage/Blocks/SpeciesDistribution/View.jsx +97 -0
- package/src/components/manage/Blocks/SpeciesDistribution/index.js +23 -0
- package/src/components/manage/Blocks/SpeciesDistribution/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesDistribution/style.less +5 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/View.jsx +97 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/index.js +23 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/style.less +5 -0
- package/src/components/manage/Blocks/StackedBarChart/Chart.jsx +127 -0
- package/src/components/manage/Blocks/StackedBarChart/ChartContext.jsx +3 -0
- package/src/components/manage/Blocks/StackedBarChart/StackedBars.jsx +116 -0
- package/src/components/manage/Blocks/StackedBarChart/View.jsx +64 -0
- package/src/components/manage/Blocks/StackedBarChart/index.js +17 -0
- package/src/components/manage/Blocks/StackedBarChart/schema.js +25 -0
- package/src/components/manage/Blocks/StackedBarChart/style.less +37 -0
- package/src/components/manage/Blocks/TilesImages/Edit.jsx +32 -0
- package/src/components/manage/Blocks/TilesImages/View.jsx +37 -0
- package/src/components/manage/Blocks/TilesImages/index.js +23 -0
- package/src/components/manage/Blocks/TilesImages/schema.js +72 -0
- package/src/components/manage/Blocks/TilesImages/styles.less +57 -0
- package/src/components/theme/AppExtras/CopyPaste/CopyPaste.jsx +176 -0
- package/src/components/theme/AppExtras/CopyPaste/index.js +3 -0
- package/src/components/theme/AppExtras/CopyPaste/style.less +18 -0
- package/src/components/theme/AppExtras/MultilingualRedirector/MultilingualRedirector.jsx +35 -0
- package/src/components/theme/AppExtras/index.js +13 -0
- package/src/components/theme/Footer/Footer.jsx +209 -0
- package/src/components/theme/Header/Header.jsx +81 -0
- package/src/components/theme/LanguageSelector/LanguageSelector.jsx +79 -0
- package/src/components/theme/LanguageSelector/styles.less +44 -0
- package/src/components/theme/Navigation/Navigation.jsx +453 -0
- package/src/components/theme/Sitemap/Sitemap.jsx +152 -0
- package/src/fonts/OpenSans-Bold.ttf +0 -0
- package/src/fonts/OpenSans-Regular.ttf +0 -0
- package/src/fonts/OpenSans-Semibold.ttf +0 -0
- package/src/fonts/Rajdhani-Bold.ttf +0 -0
- package/src/fonts/Rajdhani-Regular.ttf +0 -0
- package/src/grid.js +78 -0
- package/src/helpers.js +148 -0
- package/src/hocs/index.js +6 -0
- package/src/hocs/useResizeObserver.jsx +26 -0
- package/src/hocs/withLocalStorage.jsx +37 -0
- package/src/hocs/withScreenSize.jsx +43 -0
- package/src/icons/home.svg +12 -0
- package/src/icons/info.svg +5 -0
- package/src/icons/n2k-logo-transparent.png +0 -0
- package/src/icons/n2k-logo.png +0 -0
- package/src/icons/natura2000.svg +142 -0
- package/src/icons/placeholders/Algae.png +0 -0
- package/src/icons/placeholders/Amphibians.png +0 -0
- package/src/icons/placeholders/Birds.png +0 -0
- package/src/icons/placeholders/Conifers.png +0 -0
- package/src/icons/placeholders/Fishes.png +0 -0
- package/src/icons/placeholders/Fungi.png +0 -0
- package/src/icons/placeholders/Mammals.png +0 -0
- package/src/icons/placeholders/Plants.png +0 -0
- package/src/icons/placeholders/Reptiles.png +0 -0
- package/src/icons/placeholders/default.png +0 -0
- package/src/index.js +163 -0
- package/src/less/globals.less +3 -0
- package/src/less/styles.less +691 -0
- package/src/less/variables.less +2 -0
- package/src/static/cca.svg +61 -0
- package/src/static/ec.png +0 -0
- package/src/static/eea.png +0 -0
- package/src/static/eu.jpg +0 -0
- package/src/static/forest.svg +100 -0
- package/src/static/wise.png +0 -0
- package/src/store.js +24 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon, BlockChooser } from '@plone/volto/components';
|
|
3
|
+
import { blockHasValue } from '@plone/volto/helpers';
|
|
4
|
+
import config from '@plone/volto/registry';
|
|
5
|
+
import { Button } from 'semantic-ui-react';
|
|
6
|
+
import includes from 'lodash/includes';
|
|
7
|
+
import isBoolean from 'lodash/isBoolean';
|
|
8
|
+
import { defineMessages, injectIntl } from 'react-intl';
|
|
9
|
+
import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib';
|
|
10
|
+
import cx from 'classnames';
|
|
11
|
+
|
|
12
|
+
import dragSVG from '@plone/volto/icons/drag.svg';
|
|
13
|
+
import addSVG from '@plone/volto/icons/circle-plus.svg';
|
|
14
|
+
import trashSVG from '@plone/volto/icons/delete.svg';
|
|
15
|
+
|
|
16
|
+
const messages = defineMessages({
|
|
17
|
+
unknownBlock: {
|
|
18
|
+
id: 'Unknown Block',
|
|
19
|
+
defaultMessage: 'Unknown Block {block}',
|
|
20
|
+
},
|
|
21
|
+
delete: {
|
|
22
|
+
id: 'delete',
|
|
23
|
+
defaultMessage: 'delete',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
class EditBlockWrapper extends React.Component {
|
|
28
|
+
constructor(props) {
|
|
29
|
+
super(props);
|
|
30
|
+
this.state = {
|
|
31
|
+
addNewBlockOpened: false,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
componentDidMount() {
|
|
36
|
+
document.addEventListener('mousedown', this.handleClickOutside, false);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
componentWillUnmount() {
|
|
40
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
handleClickOutside = (e) => {
|
|
44
|
+
if (
|
|
45
|
+
this.blockNode.current &&
|
|
46
|
+
doesNodeContainClick(this.blockNode.current, e)
|
|
47
|
+
) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (this.state.addNewBlockOpened) {
|
|
52
|
+
this.setState({
|
|
53
|
+
addNewBlockOpened: false,
|
|
54
|
+
});
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
blockNode = React.createRef();
|
|
60
|
+
|
|
61
|
+
render() {
|
|
62
|
+
const { intl, blockProps, draginfo, extraControls, children } = this.props;
|
|
63
|
+
|
|
64
|
+
const {
|
|
65
|
+
allowedBlocks,
|
|
66
|
+
block,
|
|
67
|
+
data,
|
|
68
|
+
onDeleteBlock,
|
|
69
|
+
onMutateBlock,
|
|
70
|
+
selected,
|
|
71
|
+
} = blockProps;
|
|
72
|
+
const type = data['@type'];
|
|
73
|
+
const { disableNewBlocks } = data;
|
|
74
|
+
const visible = !data.fixed;
|
|
75
|
+
|
|
76
|
+
const required = isBoolean(data.required)
|
|
77
|
+
? data.required
|
|
78
|
+
: includes(config.blocks.requiredBlocks, type);
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div ref={this.blockNode} className="block-wrapper">
|
|
82
|
+
<div
|
|
83
|
+
ref={draginfo?.innerRef}
|
|
84
|
+
{...(selected ? draginfo?.draggableProps : null)}
|
|
85
|
+
className={`block-editor-${data['@type']}`}
|
|
86
|
+
>
|
|
87
|
+
{!selected && (
|
|
88
|
+
<div
|
|
89
|
+
style={{
|
|
90
|
+
display: 'none',
|
|
91
|
+
// keep react-beautiful-dnd happy
|
|
92
|
+
}}
|
|
93
|
+
{...draginfo.dragHandleProps}
|
|
94
|
+
></div>
|
|
95
|
+
)}
|
|
96
|
+
{selected && (
|
|
97
|
+
<div className="block-toolbar">
|
|
98
|
+
<div
|
|
99
|
+
style={{
|
|
100
|
+
display: visible ? 'inline-block' : 'none',
|
|
101
|
+
}}
|
|
102
|
+
{...draginfo.dragHandleProps}
|
|
103
|
+
className="drag handle wrapper-column-block"
|
|
104
|
+
>
|
|
105
|
+
<Button icon basic title="Drag and drop">
|
|
106
|
+
<Icon name={dragSVG} size="19px" />
|
|
107
|
+
</Button>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
{extraControls}
|
|
111
|
+
|
|
112
|
+
{!disableNewBlocks && !blockHasValue(data) && (
|
|
113
|
+
<Button
|
|
114
|
+
icon
|
|
115
|
+
basic
|
|
116
|
+
title="Add block"
|
|
117
|
+
onClick={() => {
|
|
118
|
+
this.setState({
|
|
119
|
+
addNewBlockOpened: !this.state.addNewBlockOpened,
|
|
120
|
+
});
|
|
121
|
+
}}
|
|
122
|
+
className="column-block-add-button"
|
|
123
|
+
>
|
|
124
|
+
<Icon name={addSVG} className="" size="19px" />
|
|
125
|
+
</Button>
|
|
126
|
+
)}
|
|
127
|
+
{!required && (
|
|
128
|
+
<Button
|
|
129
|
+
icon
|
|
130
|
+
basic
|
|
131
|
+
title="Remove block"
|
|
132
|
+
onClick={() => onDeleteBlock(block)}
|
|
133
|
+
className="delete-button-column-block"
|
|
134
|
+
aria-label={intl.formatMessage(messages.delete)}
|
|
135
|
+
>
|
|
136
|
+
<Icon name={trashSVG} size="19px" />
|
|
137
|
+
</Button>
|
|
138
|
+
)}
|
|
139
|
+
{this.state.addNewBlockOpened && (
|
|
140
|
+
<BlockChooser
|
|
141
|
+
onMutateBlock={(id, value) => {
|
|
142
|
+
this.setState({ addNewBlockOpened: false });
|
|
143
|
+
onMutateBlock(id, value);
|
|
144
|
+
}}
|
|
145
|
+
currentBlock={block}
|
|
146
|
+
allowedBlocks={allowedBlocks}
|
|
147
|
+
/>
|
|
148
|
+
)}
|
|
149
|
+
</div>
|
|
150
|
+
)}
|
|
151
|
+
|
|
152
|
+
<div className={cx('ui drag block wrapper inner', type)}>
|
|
153
|
+
{children}
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export default injectIntl(EditBlockWrapper);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Grid } from 'semantic-ui-react';
|
|
3
|
+
import { RenderBlocks, UniversalLink } from '@plone/volto/components';
|
|
4
|
+
import DefaultView from './DefalutView';
|
|
5
|
+
import hiker from './images/hiker.webp';
|
|
6
|
+
import { tileProps, getStyle } from './index';
|
|
7
|
+
import './style.less';
|
|
8
|
+
|
|
9
|
+
const View = (props) => {
|
|
10
|
+
const { data = {} } = props;
|
|
11
|
+
const { useDefault = true, tiles = [] } = data;
|
|
12
|
+
const metadata = props.metadata || props.properties;
|
|
13
|
+
const blocksData = data?.data || {};
|
|
14
|
+
|
|
15
|
+
return useDefault ? (
|
|
16
|
+
<DefaultView {...props} />
|
|
17
|
+
) : (
|
|
18
|
+
<div className="landing-page-wrapper full-width" style={getStyle(props)}>
|
|
19
|
+
<Grid className="landing-page" container columns="12">
|
|
20
|
+
<Grid.Row>
|
|
21
|
+
<Grid.Column
|
|
22
|
+
className="landing-page-description"
|
|
23
|
+
widescreen="6"
|
|
24
|
+
largeScreen="6"
|
|
25
|
+
computer="6"
|
|
26
|
+
tablet="12"
|
|
27
|
+
mobile="12"
|
|
28
|
+
>
|
|
29
|
+
<RenderBlocks {...props} metadata={metadata} content={blocksData} />
|
|
30
|
+
</Grid.Column>
|
|
31
|
+
<Grid.Column
|
|
32
|
+
className="landing-page-tiles"
|
|
33
|
+
widescreen="6"
|
|
34
|
+
largeScreen="6"
|
|
35
|
+
computer="6"
|
|
36
|
+
tablet="5"
|
|
37
|
+
mobile="7"
|
|
38
|
+
>
|
|
39
|
+
<Grid style={{ justifyContent: 'space-around' }}>
|
|
40
|
+
{tiles.map((item, index) => (
|
|
41
|
+
<Grid.Column
|
|
42
|
+
key={`item-${index}`}
|
|
43
|
+
className="item"
|
|
44
|
+
{...tileProps}
|
|
45
|
+
>
|
|
46
|
+
<UniversalLink href={item.link || '#'} title={item.title}>
|
|
47
|
+
<img
|
|
48
|
+
className="image"
|
|
49
|
+
src={`${item.image}/@@images/image`}
|
|
50
|
+
alt={item.title}
|
|
51
|
+
/>
|
|
52
|
+
<p className="description">{item.description}</p>
|
|
53
|
+
</UniversalLink>
|
|
54
|
+
</Grid.Column>
|
|
55
|
+
))}
|
|
56
|
+
</Grid>
|
|
57
|
+
</Grid.Column>
|
|
58
|
+
</Grid.Row>
|
|
59
|
+
</Grid>
|
|
60
|
+
<img className="slick-image" src={hiker} alt="Hiker" />
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default View;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import worldSVG from '@plone/volto/icons/world.svg';
|
|
2
|
+
import Edit from './Edit';
|
|
3
|
+
import View from './View';
|
|
4
|
+
import coasts_and_seas from './images/coasts_and_seas.webp';
|
|
5
|
+
import forests from './images/forests.webp';
|
|
6
|
+
import mountains from './images/mountains.webp';
|
|
7
|
+
import grasslands from './images/grasslands.webp';
|
|
8
|
+
import rivers from './images/rivers.webp';
|
|
9
|
+
import islands from './images/islands.webp';
|
|
10
|
+
import peatlands from './images/peatlands.webp';
|
|
11
|
+
import natura2000 from './images/natura2000.webp';
|
|
12
|
+
|
|
13
|
+
export const tiles = [
|
|
14
|
+
{
|
|
15
|
+
image: natura2000,
|
|
16
|
+
title: 'Natura 2000',
|
|
17
|
+
description: 'NATURA 2000',
|
|
18
|
+
link: '/natura2000/natura2000',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
image: coasts_and_seas,
|
|
22
|
+
title: 'Coasts and seas',
|
|
23
|
+
description: 'COASTS AND SEAS',
|
|
24
|
+
link: '/natura2000/:lang/coasts-and-seas',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
image: peatlands,
|
|
28
|
+
title: 'Peatlands',
|
|
29
|
+
description: 'PEATLANDS',
|
|
30
|
+
link: '/natura2000/:lang/peatlands',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
image: forests,
|
|
34
|
+
title: 'Forests',
|
|
35
|
+
description: 'FORESTS',
|
|
36
|
+
link: '/natura2000/:lang/forests',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
image: mountains,
|
|
40
|
+
title: 'Mountains',
|
|
41
|
+
description: 'MOUNTAINS',
|
|
42
|
+
link: '/natura2000/:lang/mountains',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
image: grasslands,
|
|
46
|
+
title: 'Grasslands',
|
|
47
|
+
description: 'GRASSLANDS',
|
|
48
|
+
link: '/natura2000/:lang/grasslands',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
image: rivers,
|
|
52
|
+
title: 'Rivers and lakes',
|
|
53
|
+
description: 'RIVERS AND LAKES',
|
|
54
|
+
link: '/natura2000/:lang/rivers-and-lakes',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
image: islands,
|
|
58
|
+
title: 'Islands',
|
|
59
|
+
description: 'ISLANDS',
|
|
60
|
+
link: '/natura2000/:lang/islands',
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const tileProps = {
|
|
65
|
+
mobile: 12,
|
|
66
|
+
tablet: 12,
|
|
67
|
+
computer: 6,
|
|
68
|
+
largeScreen: 6,
|
|
69
|
+
widescreen: 6,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const getStyle = (props) => {
|
|
73
|
+
if (!props.screen) return {};
|
|
74
|
+
if (!props.screen.width || !props.screen.height) return {};
|
|
75
|
+
return {
|
|
76
|
+
minHeight: (
|
|
77
|
+
props.screen.height - props.screen.browserToolbarHeight
|
|
78
|
+
).toPixel(),
|
|
79
|
+
maxHeight: (
|
|
80
|
+
props.screen.height - props.screen.browserToolbarHeight
|
|
81
|
+
).toPixel(),
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default (config) => {
|
|
86
|
+
config.blocks.blocksConfig.landing_block = {
|
|
87
|
+
id: 'landing_block',
|
|
88
|
+
title: 'Landing block',
|
|
89
|
+
icon: worldSVG,
|
|
90
|
+
group: 'natura_2000',
|
|
91
|
+
edit: Edit,
|
|
92
|
+
view: View,
|
|
93
|
+
restricted: false,
|
|
94
|
+
mostUsed: false,
|
|
95
|
+
sidebarTab: 1,
|
|
96
|
+
blocks: {},
|
|
97
|
+
security: {
|
|
98
|
+
addPermission: [],
|
|
99
|
+
view: [],
|
|
100
|
+
},
|
|
101
|
+
blockHasOwnFocusManagement: true,
|
|
102
|
+
};
|
|
103
|
+
return config;
|
|
104
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const tileSchema = () => ({
|
|
2
|
+
title: 'Tile',
|
|
3
|
+
fieldsets: [
|
|
4
|
+
{
|
|
5
|
+
id: 'default',
|
|
6
|
+
title: 'Default',
|
|
7
|
+
fields: ['title', 'description', 'link', 'image', 'copyright'],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
|
|
11
|
+
properties: {
|
|
12
|
+
title: {
|
|
13
|
+
title: 'Title',
|
|
14
|
+
type: 'text',
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
title: 'Description',
|
|
18
|
+
type: 'text',
|
|
19
|
+
},
|
|
20
|
+
link: {
|
|
21
|
+
title: 'Link',
|
|
22
|
+
widget: 'object_by_path',
|
|
23
|
+
},
|
|
24
|
+
image: {
|
|
25
|
+
title: 'Image',
|
|
26
|
+
widget: 'object_by_path',
|
|
27
|
+
},
|
|
28
|
+
copyright: {
|
|
29
|
+
title: 'Copyright',
|
|
30
|
+
type: 'text',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
required: ['attachedimage'],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const getSchema = () => ({
|
|
38
|
+
title: 'Landing block',
|
|
39
|
+
fieldsets: [
|
|
40
|
+
{
|
|
41
|
+
id: 'default',
|
|
42
|
+
title: 'Default',
|
|
43
|
+
fields: ['useDefault', 'tiles'],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
properties: {
|
|
47
|
+
useDefault: {
|
|
48
|
+
title: 'Use default tiles',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
default: true,
|
|
51
|
+
},
|
|
52
|
+
tiles: {
|
|
53
|
+
title: 'Tiles',
|
|
54
|
+
widget: 'object_list_inline',
|
|
55
|
+
description: 'Add a list of tiles',
|
|
56
|
+
schema: tileSchema(),
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
required: [],
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export default getSchema;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
@import (multiple, reference, optional) '../../theme.config';
|
|
2
|
+
@type: extra;
|
|
3
|
+
@element: custom;
|
|
4
|
+
|
|
5
|
+
div#view .ui.container > {
|
|
6
|
+
.landing-page-wrapper {
|
|
7
|
+
margin-bottom: 0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.landing-page-wrapper {
|
|
12
|
+
position: relative;
|
|
13
|
+
padding-top: 4rem;
|
|
14
|
+
background-image: url('./images/background.webp');
|
|
15
|
+
background-repeat: no-repeat;
|
|
16
|
+
background-size: cover;
|
|
17
|
+
|
|
18
|
+
&:not(.edit) {
|
|
19
|
+
overflow-y: hidden;
|
|
20
|
+
|
|
21
|
+
.ui.grid.landing-page {
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ui.grid.landing-page {
|
|
27
|
+
z-index: 1;
|
|
28
|
+
max-height: inherit;
|
|
29
|
+
|
|
30
|
+
/* Hide scrollbar for IE, Edge and Firefox */
|
|
31
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
32
|
+
scrollbar-width: none; /* Firefox */
|
|
33
|
+
|
|
34
|
+
> .row {
|
|
35
|
+
z-index: 1;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
padding-bottom: 5rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Hide scrollbar for Chrome, Safari and Opera */
|
|
41
|
+
&::-webkit-scrollbar {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.landing-page-description {
|
|
46
|
+
margin-bottom: 3rem;
|
|
47
|
+
color: #fff;
|
|
48
|
+
|
|
49
|
+
p {
|
|
50
|
+
font-size: 20px;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.landing-page-tiles {
|
|
57
|
+
a:hover {
|
|
58
|
+
opacity: 0.9;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
a:active {
|
|
62
|
+
opacity: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.item a {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-flow: column;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.item img.image {
|
|
71
|
+
width: 100%;
|
|
72
|
+
// max-width: 200px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.item p.description {
|
|
76
|
+
position: relative;
|
|
77
|
+
margin-top: 1rem;
|
|
78
|
+
color: #fff;
|
|
79
|
+
font-size: 0.9em;
|
|
80
|
+
font-weight: bold;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.column {
|
|
84
|
+
text-align: center;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.block-toolbar {
|
|
89
|
+
position: absolute;
|
|
90
|
+
z-index: 3;
|
|
91
|
+
left: -9px;
|
|
92
|
+
display: flex;
|
|
93
|
+
padding: 5px;
|
|
94
|
+
border: none;
|
|
95
|
+
border: 1px solid #78c0d7bf;
|
|
96
|
+
border-bottom: 1px solid #fff;
|
|
97
|
+
margin-top: -45px;
|
|
98
|
+
background-color: #fff;
|
|
99
|
+
|
|
100
|
+
.ui.basic.button {
|
|
101
|
+
padding: 3px;
|
|
102
|
+
padding-right: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.wrapper-column-block {
|
|
106
|
+
> .ui.basic.button {
|
|
107
|
+
&:hover {
|
|
108
|
+
background-color: transparent !important;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
> .ui.basic.button {
|
|
114
|
+
&:hover {
|
|
115
|
+
background-color: transparent !important;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
svg {
|
|
119
|
+
color: #134448;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.drag.handle.wrapper-column-block {
|
|
124
|
+
position: initial;
|
|
125
|
+
left: initial;
|
|
126
|
+
min-height: 1em;
|
|
127
|
+
margin-left: initial !important;
|
|
128
|
+
font-size: 1rem;
|
|
129
|
+
line-height: 1em;
|
|
130
|
+
vertical-align: baseline;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.blocks-chooser {
|
|
135
|
+
left: 0;
|
|
136
|
+
margin-top: 50px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.block {
|
|
140
|
+
.block-add-button,
|
|
141
|
+
.delete-button {
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.slick-image {
|
|
147
|
+
z-index: 0 !important;
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// @media only screen and (max-width: @largeMonitorBreakpoint + @offset) {
|
|
153
|
+
// .natura2000-theme {
|
|
154
|
+
// .landing-page-wrapper {
|
|
155
|
+
// .ui.grid.landing-page {
|
|
156
|
+
// > .row {
|
|
157
|
+
// justify-content: flex-end;
|
|
158
|
+
// }
|
|
159
|
+
// }
|
|
160
|
+
// }
|
|
161
|
+
// }
|
|
162
|
+
// }
|
|
163
|
+
|
|
164
|
+
@media only screen and (max-width: @largestTabletScreen) {
|
|
165
|
+
.natura2000-theme {
|
|
166
|
+
.landing-page-wrapper {
|
|
167
|
+
.ui.grid.landing-page {
|
|
168
|
+
> .row {
|
|
169
|
+
justify-content: flex-end;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Grid } from 'semantic-ui-react';
|
|
3
|
+
import './style.less';
|
|
4
|
+
|
|
5
|
+
const View = (props) => {
|
|
6
|
+
const { data = {} } = props;
|
|
7
|
+
const provider_data = props.provider_data || {};
|
|
8
|
+
const columns = provider_data[Object.keys(provider_data)?.[0]]?.length || 0;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div className="connected-list">
|
|
12
|
+
{props.mode === 'edit' ? <p>Connected list</p> : ''}
|
|
13
|
+
<Grid columns={data.grid_size}>
|
|
14
|
+
<Grid.Row>
|
|
15
|
+
{Array(Math.max(0, columns))
|
|
16
|
+
.fill()
|
|
17
|
+
.map((_, column) => (
|
|
18
|
+
<Grid.Column key={`connected-list-${column}`}>
|
|
19
|
+
{(data.labeled ?? true) && data.label ? (
|
|
20
|
+
<p className="label">{provider_data[data.label][column]}</p>
|
|
21
|
+
) : (
|
|
22
|
+
''
|
|
23
|
+
)}
|
|
24
|
+
{data.value ? (
|
|
25
|
+
<p className="value">{provider_data[data.value][column]}</p>
|
|
26
|
+
) : (
|
|
27
|
+
''
|
|
28
|
+
)}
|
|
29
|
+
</Grid.Column>
|
|
30
|
+
))}
|
|
31
|
+
</Grid.Row>
|
|
32
|
+
</Grid>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default View;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ListView from './View';
|
|
2
|
+
import getSchema from './schema';
|
|
3
|
+
|
|
4
|
+
export default (config) => {
|
|
5
|
+
config.blocks.blocksConfig.custom_connected_block = {
|
|
6
|
+
...config.blocks.blocksConfig.custom_connected_block,
|
|
7
|
+
blocks: {
|
|
8
|
+
...config.blocks.blocksConfig.custom_connected_block.blocks,
|
|
9
|
+
list: {
|
|
10
|
+
view: ListView,
|
|
11
|
+
getSchema: getSchema,
|
|
12
|
+
title: 'List',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const getSchema = (props) => {
|
|
2
|
+
const data = props.provider_data || {};
|
|
3
|
+
const choices = Object.keys(data).map((key) => [key, key]);
|
|
4
|
+
|
|
5
|
+
return {
|
|
6
|
+
title: 'List',
|
|
7
|
+
|
|
8
|
+
fieldsets: [
|
|
9
|
+
{
|
|
10
|
+
id: 'default',
|
|
11
|
+
title: 'Default',
|
|
12
|
+
fields: [
|
|
13
|
+
'labeled',
|
|
14
|
+
'value',
|
|
15
|
+
...(props.data.labeled ?? true ? ['label'] : []),
|
|
16
|
+
'grid_size',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
properties: {
|
|
22
|
+
labeled: {
|
|
23
|
+
title: 'Has label',
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
default: true,
|
|
26
|
+
},
|
|
27
|
+
value: {
|
|
28
|
+
title: 'Value',
|
|
29
|
+
type: 'array',
|
|
30
|
+
choices,
|
|
31
|
+
},
|
|
32
|
+
label: {
|
|
33
|
+
title: 'Label',
|
|
34
|
+
type: 'array',
|
|
35
|
+
choices,
|
|
36
|
+
},
|
|
37
|
+
grid_size: {
|
|
38
|
+
title: 'Grid size',
|
|
39
|
+
widget: 'number',
|
|
40
|
+
min: 0,
|
|
41
|
+
max: 12,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
required: [],
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default getSchema;
|