@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,47 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
import { makeInlineElementPlugin } from 'volto-slate/components/ElementEditor';
|
|
3
|
+
import { SlateSvgSchema } from './schema';
|
|
4
|
+
import { withSlateSvg } from './extensions';
|
|
5
|
+
import { SLATESVG } from './constants';
|
|
6
|
+
import { SlateSvgElement } from './render';
|
|
7
|
+
import triangleSVG from '@plone/volto/icons/triangle.svg';
|
|
8
|
+
|
|
9
|
+
import './styles.less';
|
|
10
|
+
|
|
11
|
+
const messages = defineMessages({
|
|
12
|
+
edit: {
|
|
13
|
+
id: 'Edit slate svg',
|
|
14
|
+
defaultMessage: 'Edit slate svg',
|
|
15
|
+
},
|
|
16
|
+
delete: {
|
|
17
|
+
id: 'Remove slate svg',
|
|
18
|
+
defaultMessage: 'Remove slate svg',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default function install(config) {
|
|
23
|
+
const opts = {
|
|
24
|
+
pluginId: SLATESVG,
|
|
25
|
+
elementType: SLATESVG,
|
|
26
|
+
element: SlateSvgElement,
|
|
27
|
+
editSchema: SlateSvgSchema,
|
|
28
|
+
isInlineElement: true,
|
|
29
|
+
hasValue: () => true,
|
|
30
|
+
extensions: [withSlateSvg],
|
|
31
|
+
toolbarButtonIcon: triangleSVG,
|
|
32
|
+
title: 'Slate svg',
|
|
33
|
+
messages,
|
|
34
|
+
};
|
|
35
|
+
const [installSlateSvgEditor] = makeInlineElementPlugin(opts);
|
|
36
|
+
config = installSlateSvgEditor(config);
|
|
37
|
+
|
|
38
|
+
const { slate } = config.settings;
|
|
39
|
+
|
|
40
|
+
slate.toolbarButtons = [...(slate.toolbarButtons || []), 'slatesvg'];
|
|
41
|
+
slate.expandedToolbarButtons = [
|
|
42
|
+
...(slate.expandedToolbarButtons || []),
|
|
43
|
+
'slatesvg',
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
return config;
|
|
47
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export const SlateSvgElement = ({
|
|
4
|
+
attributes,
|
|
5
|
+
children,
|
|
6
|
+
element,
|
|
7
|
+
mode,
|
|
8
|
+
...rest
|
|
9
|
+
}) => {
|
|
10
|
+
return mode === 'view' ? (
|
|
11
|
+
<>
|
|
12
|
+
<svg width="100%" height="100%" viewBox="0 0 280 280">
|
|
13
|
+
<foreignObject
|
|
14
|
+
width="100%"
|
|
15
|
+
height="100%"
|
|
16
|
+
position="absolute"
|
|
17
|
+
x="0"
|
|
18
|
+
y="0"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
{...attributes}
|
|
22
|
+
classname="slate-svg"
|
|
23
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
24
|
+
style={{
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
width: '100%',
|
|
27
|
+
top: '50%',
|
|
28
|
+
left: '50%',
|
|
29
|
+
transform: 'translate(-50%, -50%)',
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
</foreignObject>
|
|
35
|
+
</svg>
|
|
36
|
+
</>
|
|
37
|
+
) : (
|
|
38
|
+
<span {...attributes} className="slate-svg slate-svg-edit">
|
|
39
|
+
{children}
|
|
40
|
+
</span>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container } from 'semantic-ui-react';
|
|
3
|
+
import loadable from '@loadable/component';
|
|
4
|
+
import { photoPlaceholders } from '@eeacms/volto-n2k/helpers';
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import './style.less';
|
|
7
|
+
import 'slick-carousel/slick/slick.css';
|
|
8
|
+
import 'slick-carousel/slick/slick-theme.css';
|
|
9
|
+
|
|
10
|
+
const Slider = loadable(() => import('react-slick'));
|
|
11
|
+
|
|
12
|
+
const View = (props) => {
|
|
13
|
+
const slider = React.useRef(null);
|
|
14
|
+
const provider_data = props.provider_data || {};
|
|
15
|
+
const {
|
|
16
|
+
author = [],
|
|
17
|
+
common_name = [],
|
|
18
|
+
common_name_list = [],
|
|
19
|
+
id_eunis = [],
|
|
20
|
+
license = [],
|
|
21
|
+
picture_url = [],
|
|
22
|
+
scientific_name = [],
|
|
23
|
+
source = [],
|
|
24
|
+
source_url = [],
|
|
25
|
+
species_group_name = [],
|
|
26
|
+
} = provider_data;
|
|
27
|
+
|
|
28
|
+
const sliderSettings = {
|
|
29
|
+
adaptiveHeight: true,
|
|
30
|
+
autoplay: true,
|
|
31
|
+
autoplaySpeed: 5000,
|
|
32
|
+
arrows: true,
|
|
33
|
+
cssEase: 'ease',
|
|
34
|
+
dots: false,
|
|
35
|
+
speed: 500,
|
|
36
|
+
initialSlide: 0,
|
|
37
|
+
lazyLoad: 'ondemand',
|
|
38
|
+
swipe: true,
|
|
39
|
+
slidesToShow: 1,
|
|
40
|
+
slidesToScroll: 1,
|
|
41
|
+
touchMove: true,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (!id_eunis[0]) return '';
|
|
45
|
+
return (
|
|
46
|
+
<div className="species-banner-details full-width">
|
|
47
|
+
<Container>
|
|
48
|
+
<div className="species-details">
|
|
49
|
+
<div className="species-metadata">
|
|
50
|
+
<h2 className="name">{scientific_name[0]}</h2>
|
|
51
|
+
<p className="info">
|
|
52
|
+
{common_name[0] ? common_name[0] + ' - ' : ''} {author[0]}
|
|
53
|
+
</p>
|
|
54
|
+
{common_name_list[0] ? (
|
|
55
|
+
<p className="info">Common names: {common_name_list[0]}</p>
|
|
56
|
+
) : (
|
|
57
|
+
''
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
60
|
+
<div
|
|
61
|
+
className={cx('species-pictures', {
|
|
62
|
+
'with-slider': picture_url.length > 0 && picture_url[0],
|
|
63
|
+
})}
|
|
64
|
+
>
|
|
65
|
+
{picture_url.length > 0 && picture_url[0] ? (
|
|
66
|
+
<Slider {...sliderSettings} ref={slider}>
|
|
67
|
+
{picture_url.map((picture, index) => (
|
|
68
|
+
<div key={`${picture}_${index}`} className="picture-wrapper">
|
|
69
|
+
<img src={picture} alt={common_name[0]} />
|
|
70
|
+
<div className="source">
|
|
71
|
+
<a
|
|
72
|
+
href={source_url[index]}
|
|
73
|
+
title={'Picture source'}
|
|
74
|
+
target="_blank"
|
|
75
|
+
rel="noreferrer"
|
|
76
|
+
>
|
|
77
|
+
{source[index]}
|
|
78
|
+
{license[index] ? (
|
|
79
|
+
<>
|
|
80
|
+
,<br />
|
|
81
|
+
{license[index]}
|
|
82
|
+
</>
|
|
83
|
+
) : (
|
|
84
|
+
''
|
|
85
|
+
)}
|
|
86
|
+
</a>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
))}
|
|
90
|
+
</Slider>
|
|
91
|
+
) : (
|
|
92
|
+
<div className="picture-wrapper">
|
|
93
|
+
<img
|
|
94
|
+
src={
|
|
95
|
+
photoPlaceholders[species_group_name[0]] ||
|
|
96
|
+
photoPlaceholders.default
|
|
97
|
+
}
|
|
98
|
+
alt={species_group_name[0]}
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</Container>
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default View;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import SpeciesBannerView 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
|
+
species_banner: {
|
|
10
|
+
view: SpeciesBannerView,
|
|
11
|
+
getSchema: getSchema,
|
|
12
|
+
title: 'Species banner',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
div#view .species-banner-details .ui.container > * {
|
|
2
|
+
margin-top: 0;
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.species-banner-details {
|
|
7
|
+
padding: 1.5em 0;
|
|
8
|
+
background-color: #04a77d;
|
|
9
|
+
color: #fff;
|
|
10
|
+
font-family: 'RajdhaniB';
|
|
11
|
+
|
|
12
|
+
.species-details {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-flow: row;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
|
|
18
|
+
@media only screen and (max-width: 800px) {
|
|
19
|
+
flex-flow: column;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.species-metadata {
|
|
23
|
+
.name {
|
|
24
|
+
margin-top: 0 !important;
|
|
25
|
+
margin-bottom: 0 !important;
|
|
26
|
+
color: #fff;
|
|
27
|
+
font-family: inherit;
|
|
28
|
+
font-size: 54px;
|
|
29
|
+
line-height: 54px;
|
|
30
|
+
text-transform: uppercase;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.info {
|
|
34
|
+
margin-bottom: 1rem;
|
|
35
|
+
font-family: 'RajdhaniR';
|
|
36
|
+
font-size: 18px;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
line-height: 18px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.slick-slider {
|
|
43
|
+
.slick-arrow {
|
|
44
|
+
display: block !important;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.species-pictures {
|
|
49
|
+
width: 400px;
|
|
50
|
+
height: 400px;
|
|
51
|
+
margin-bottom: 1rem;
|
|
52
|
+
|
|
53
|
+
.picture-wrapper {
|
|
54
|
+
position: relative;
|
|
55
|
+
display: flex !important;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
width: 400px;
|
|
58
|
+
height: 400px;
|
|
59
|
+
flex-flow: column;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
background-color: #000;
|
|
63
|
+
border-radius: 10px;
|
|
64
|
+
|
|
65
|
+
img {
|
|
66
|
+
width: auto;
|
|
67
|
+
max-width: 400px;
|
|
68
|
+
height: auto;
|
|
69
|
+
max-height: 400px;
|
|
70
|
+
filter: drop-shadow(-2px 2px 3px rgba(0, 0, 0, 0.4));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.source {
|
|
74
|
+
position: absolute;
|
|
75
|
+
bottom: 0;
|
|
76
|
+
left: 0;
|
|
77
|
+
width: 100%;
|
|
78
|
+
padding: 0.5rem 1rem;
|
|
79
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
80
|
+
border-bottom-left-radius: 3px;
|
|
81
|
+
border-bottom-right-radius: 3px;
|
|
82
|
+
|
|
83
|
+
a {
|
|
84
|
+
margin-top: 1rem;
|
|
85
|
+
color: #fff;
|
|
86
|
+
|
|
87
|
+
&:hover {
|
|
88
|
+
color: #fff;
|
|
89
|
+
text-decoration: underline;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:not(.with-slider) {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
|
|
99
|
+
.picture-wrapper {
|
|
100
|
+
height: fit-content;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.slick-slide:not(.slick-active) {
|
|
107
|
+
opacity: 0;
|
|
108
|
+
transition: opacity 0.6s;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.slick-slide {
|
|
112
|
+
opacity: 1;
|
|
113
|
+
transition: opacity 0.4s;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
// import { UniversalLink } from '@plone/volto/components';
|
|
3
|
+
import './style.less';
|
|
4
|
+
|
|
5
|
+
const View = (props) => {
|
|
6
|
+
// const provider_data = props.provider_data || {};
|
|
7
|
+
return (
|
|
8
|
+
<div className="species-classification">
|
|
9
|
+
{props.mode === 'edit' ? <p>Species classification</p> : ''}
|
|
10
|
+
{/* {Array(Math.max(0, rows))
|
|
11
|
+
.fill()
|
|
12
|
+
.map((_, row) => (
|
|
13
|
+
|
|
14
|
+
))} */}
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default View;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import SpeciesClassification 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
|
+
species_classification: {
|
|
10
|
+
view: SpeciesClassification,
|
|
11
|
+
getSchema: getSchema,
|
|
12
|
+
title: 'Species classification',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const getSchema = (props) => {
|
|
2
|
+
return {
|
|
3
|
+
title: 'Species classification',
|
|
4
|
+
|
|
5
|
+
fieldsets: [
|
|
6
|
+
{
|
|
7
|
+
id: 'default',
|
|
8
|
+
title: 'Default',
|
|
9
|
+
fields: [],
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
|
|
13
|
+
properties: {},
|
|
14
|
+
|
|
15
|
+
required: [],
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default getSchema;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { Message, Container } from 'semantic-ui-react';
|
|
3
|
+
import Map from '@eeacms/volto-openlayers-map/Map';
|
|
4
|
+
import { Interactions } from '@eeacms/volto-openlayers-map/Interactions';
|
|
5
|
+
import { Controls } from '@eeacms/volto-openlayers-map/Controls';
|
|
6
|
+
import { Layers, Layer } from '@eeacms/volto-openlayers-map/Layers';
|
|
7
|
+
import { openlayers } from '@eeacms/volto-openlayers-map';
|
|
8
|
+
import { getSpeciesDistributionURL } from './index';
|
|
9
|
+
import './style.less';
|
|
10
|
+
|
|
11
|
+
const View = (props) => {
|
|
12
|
+
const [options, setOptions] = React.useState({});
|
|
13
|
+
const [vectorSource, setVectorSource] = useState(null);
|
|
14
|
+
const { extent, format, proj, style, source } = openlayers;
|
|
15
|
+
const provider_data = props.provider_data || {};
|
|
16
|
+
const { code_2000 = [] } = provider_data;
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (__SERVER__) return;
|
|
20
|
+
setVectorSource(new source.Vector());
|
|
21
|
+
/* eslint-disable-next-line */
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (__SERVER__ || !vectorSource || !code_2000[0]) return;
|
|
26
|
+
const esrijsonFormat = new format.EsriJSON();
|
|
27
|
+
// Get species location on sites
|
|
28
|
+
fetch(getSpeciesDistributionURL(code_2000[0])).then(function (response) {
|
|
29
|
+
if (response.status !== 200) return;
|
|
30
|
+
response.json().then(function (data) {
|
|
31
|
+
if (data.features && data.features.length > 0) {
|
|
32
|
+
const features = esrijsonFormat.readFeatures(data);
|
|
33
|
+
if (features.length > 0) {
|
|
34
|
+
vectorSource.addFeatures(features);
|
|
35
|
+
const vectorExtent = vectorSource.getExtent();
|
|
36
|
+
let size = extent.getSize(vectorExtent);
|
|
37
|
+
setOptions({
|
|
38
|
+
...options,
|
|
39
|
+
extent: new extent.buffer(vectorExtent, size[0] * 0.1),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/* eslint-disable-next-line */
|
|
46
|
+
}, [code_2000?.[0]]);
|
|
47
|
+
|
|
48
|
+
if (__SERVER__ || !vectorSource) return '';
|
|
49
|
+
return (
|
|
50
|
+
<div className="species-distribution-wrapper">
|
|
51
|
+
<div className="species-distribution">
|
|
52
|
+
<Map
|
|
53
|
+
view={{
|
|
54
|
+
center: proj.fromLonLat([20, 50]),
|
|
55
|
+
showFullExtent: true,
|
|
56
|
+
zoom: 5,
|
|
57
|
+
}}
|
|
58
|
+
{...options}
|
|
59
|
+
>
|
|
60
|
+
<Layers>
|
|
61
|
+
<Layer.Tile zIndex={0} />
|
|
62
|
+
<Layer.Vector
|
|
63
|
+
source={vectorSource}
|
|
64
|
+
style={
|
|
65
|
+
new style.Style({
|
|
66
|
+
fill: new style.Fill({
|
|
67
|
+
color: 'rgba(255,255,255,0.4)',
|
|
68
|
+
}),
|
|
69
|
+
stroke: new style.Stroke({
|
|
70
|
+
color: '#04A77D',
|
|
71
|
+
width: 3,
|
|
72
|
+
}),
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
zIndex={1}
|
|
76
|
+
/>
|
|
77
|
+
</Layers>
|
|
78
|
+
<Controls attribution={true} />
|
|
79
|
+
<Interactions pointer={false} select={false} />
|
|
80
|
+
</Map>
|
|
81
|
+
</div>
|
|
82
|
+
<Container className="map-info-notice">
|
|
83
|
+
<Message>
|
|
84
|
+
<p>
|
|
85
|
+
The designations employed and the presentation of material on this
|
|
86
|
+
map do not imply the expression of any opinion whatsoever on the
|
|
87
|
+
part of the European Union concerning the legal status of any
|
|
88
|
+
country, territory, city or area or of its authorities, or
|
|
89
|
+
concerning the delimitation of its frontiers or boundaries.
|
|
90
|
+
</p>
|
|
91
|
+
</Message>
|
|
92
|
+
</Container>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default View;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import SpeciesDistributionView from './View';
|
|
2
|
+
import getSchema from './schema';
|
|
3
|
+
|
|
4
|
+
export function getSpeciesDistributionURL(code_2000) {
|
|
5
|
+
return encodeURI(
|
|
6
|
+
`https://bio.discomap.eea.europa.eu/arcgis/rest/services/Article17/HabitatsDirective_ART_17_WMS_version_2020_08_public/MapServer/3/query?f=json&where=speciescode LIKE '%${code_2000.toUpperCase()}%'&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=speciescode&outSR=102100`,
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default (config) => {
|
|
11
|
+
config.blocks.blocksConfig.custom_connected_block = {
|
|
12
|
+
...config.blocks.blocksConfig.custom_connected_block,
|
|
13
|
+
blocks: {
|
|
14
|
+
...config.blocks.blocksConfig.custom_connected_block.blocks,
|
|
15
|
+
species_distribution: {
|
|
16
|
+
view: SpeciesDistributionView,
|
|
17
|
+
getSchema: getSchema,
|
|
18
|
+
title: 'Species distribution map',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
return config;
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const getSchema = (props) => {
|
|
2
|
+
return {
|
|
3
|
+
title: 'Species distribution map',
|
|
4
|
+
|
|
5
|
+
fieldsets: [
|
|
6
|
+
{
|
|
7
|
+
id: 'default',
|
|
8
|
+
title: 'Default',
|
|
9
|
+
fields: [],
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
|
|
13
|
+
properties: {},
|
|
14
|
+
|
|
15
|
+
required: [],
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default getSchema;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { Message, Container } from 'semantic-ui-react';
|
|
3
|
+
import Map from '@eeacms/volto-openlayers-map/Map';
|
|
4
|
+
import { Interactions } from '@eeacms/volto-openlayers-map/Interactions';
|
|
5
|
+
import { Controls } from '@eeacms/volto-openlayers-map/Controls';
|
|
6
|
+
import { Layers, Layer } from '@eeacms/volto-openlayers-map/Layers';
|
|
7
|
+
import { openlayers } from '@eeacms/volto-openlayers-map';
|
|
8
|
+
import { getSpeciesProtectedSitesURL } from './index';
|
|
9
|
+
import './style.less';
|
|
10
|
+
|
|
11
|
+
const View = (props) => {
|
|
12
|
+
const [options, setOptions] = React.useState({});
|
|
13
|
+
const [vectorSource, setVectorSource] = useState(null);
|
|
14
|
+
const { extent, format, proj, style, source } = openlayers;
|
|
15
|
+
const provider_data = props.provider_data || {};
|
|
16
|
+
const { code_2000 = [] } = provider_data;
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (__SERVER__) return;
|
|
20
|
+
setVectorSource(new source.Vector());
|
|
21
|
+
/* eslint-disable-next-line */
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (__SERVER__ || !vectorSource || !code_2000[0]) return;
|
|
26
|
+
const esrijsonFormat = new format.EsriJSON();
|
|
27
|
+
// Get species protected sites
|
|
28
|
+
fetch(getSpeciesProtectedSitesURL(code_2000[0])).then(function (response) {
|
|
29
|
+
if (response.status !== 200) return;
|
|
30
|
+
response.json().then(function (data) {
|
|
31
|
+
if (data.features && data.features.length > 0) {
|
|
32
|
+
const features = esrijsonFormat.readFeatures(data);
|
|
33
|
+
if (features.length > 0) {
|
|
34
|
+
vectorSource.addFeatures(features);
|
|
35
|
+
const vectorExtent = vectorSource.getExtent();
|
|
36
|
+
let size = extent.getSize(vectorExtent);
|
|
37
|
+
setOptions({
|
|
38
|
+
...options,
|
|
39
|
+
extent: new extent.buffer(vectorExtent, size[0] * 0.1),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/* eslint-disable-next-line */
|
|
46
|
+
}, [code_2000?.[0]]);
|
|
47
|
+
|
|
48
|
+
if (__SERVER__ || !vectorSource) return '';
|
|
49
|
+
return (
|
|
50
|
+
<div className="species-protected-sites-wrapper">
|
|
51
|
+
<div className="species-protected-sites">
|
|
52
|
+
<Map
|
|
53
|
+
view={{
|
|
54
|
+
center: proj.fromLonLat([20, 50]),
|
|
55
|
+
showFullExtent: true,
|
|
56
|
+
zoom: 5,
|
|
57
|
+
}}
|
|
58
|
+
{...options}
|
|
59
|
+
>
|
|
60
|
+
<Layers>
|
|
61
|
+
<Layer.Tile zIndex={0} />
|
|
62
|
+
<Layer.VectorImage
|
|
63
|
+
source={vectorSource}
|
|
64
|
+
style={
|
|
65
|
+
new style.Style({
|
|
66
|
+
fill: new style.Fill({
|
|
67
|
+
color: 'rgba(255,255,255,0.4)',
|
|
68
|
+
}),
|
|
69
|
+
stroke: new style.Stroke({
|
|
70
|
+
color: '#04A77D',
|
|
71
|
+
width: 3,
|
|
72
|
+
}),
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
zIndex={1}
|
|
76
|
+
/>
|
|
77
|
+
</Layers>
|
|
78
|
+
<Controls attribution={true} />
|
|
79
|
+
<Interactions pointer={false} select={false} />
|
|
80
|
+
</Map>
|
|
81
|
+
</div>
|
|
82
|
+
<Container className="map-info-notice">
|
|
83
|
+
<Message>
|
|
84
|
+
<p>
|
|
85
|
+
The designations employed and the presentation of material on this
|
|
86
|
+
map do not imply the expression of any opinion whatsoever on the
|
|
87
|
+
part of the European Union concerning the legal status of any
|
|
88
|
+
country, territory, city or area or of its authorities, or
|
|
89
|
+
concerning the delimitation of its frontiers or boundaries.
|
|
90
|
+
</p>
|
|
91
|
+
</Message>
|
|
92
|
+
</Container>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default View;
|