imio.smartweb.core 1.2.37__py3-none-any.whl → 1.2.79__py3-none-any.whl
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.
- imio/smartweb/core/behaviors/categorization.py +24 -0
- imio/smartweb/core/behaviors/configure.zcml +7 -0
- imio/smartweb/core/browser/controlpanel.py +43 -0
- imio/smartweb/core/browser/faceted/block_view.pt +4 -4
- imio/smartweb/core/browser/faceted/summary_view.pt +4 -4
- imio/smartweb/core/browser/sitemap.py +10 -3
- imio/smartweb/core/browser/static/icons/action-delete.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-engagement-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/action-panneaux.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-vote.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-attention.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-infos-travaux-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-nature.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-parcs-a-conteneurs.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-plus.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-primes-2.svg +5 -0
- imio/smartweb/core/browser/static/icons/categorie-sport-natation.svg +4 -0
- imio/smartweb/core/browser/static/icons/organisation-ecole-sac.svg +4 -0
- imio/smartweb/core/browser/static/icons/organisation-scout.svg +3 -0
- imio/smartweb/core/browser/static/icons/reseausocial-behance.svg +3 -0
- imio/smartweb/core/browser/static/icons/reseausocial-linkedin.svg +3 -0
- imio/smartweb/core/browser/static/smartweb-edit-compiled.css +1 -1
- imio/smartweb/core/browser/static/smartweb-view-compiled.css +1 -1
- imio/smartweb/core/browser/static/src/edit.less +42 -0
- imio/smartweb/core/browser/static/src/view.less +109 -56
- imio/smartweb/core/browser/vocabulary.py +8 -3
- imio/smartweb/core/contents/__init__.py +2 -0
- imio/smartweb/core/contents/configure.zcml +1 -0
- imio/smartweb/core/contents/folder/block_view.pt +8 -8
- imio/smartweb/core/contents/folder/summary_view.pt +4 -4
- imio/smartweb/core/contents/pages/cirkwi/content.py +5 -0
- imio/smartweb/core/contents/pages/cirkwi/view.py +2 -1
- imio/smartweb/core/contents/pages/configure.zcml +1 -0
- imio/smartweb/core/contents/pages/portal_page/view.py +3 -0
- imio/smartweb/core/contents/pages/views.py +47 -1
- imio/smartweb/core/contents/publication/__init__.py +0 -0
- imio/smartweb/core/contents/publication/configure.zcml +5 -0
- imio/smartweb/core/contents/publication/content.py +23 -0
- imio/smartweb/core/contents/rest/base.py +9 -7
- imio/smartweb/core/contents/rest/directory/endpoint.py +2 -2
- imio/smartweb/core/contents/rest/directory/view.pt +2 -1
- imio/smartweb/core/contents/rest/events/content.py +13 -0
- imio/smartweb/core/contents/rest/events/endpoint.py +5 -3
- imio/smartweb/core/contents/rest/events/view.pt +5 -1
- imio/smartweb/core/contents/rest/events/view.py +12 -0
- imio/smartweb/core/contents/rest/news/content.py +6 -0
- imio/smartweb/core/contents/rest/news/endpoint.py +4 -2
- imio/smartweb/core/contents/rest/news/view.pt +4 -1
- imio/smartweb/core/contents/rest/news/view.py +8 -0
- imio/smartweb/core/contents/rest/utils.py +0 -1
- imio/smartweb/core/contents/rest/view.py +4 -0
- imio/smartweb/core/contents/sections/common_templates/carousel.pt +5 -1
- imio/smartweb/core/contents/sections/common_templates/table.pt +18 -4
- imio/smartweb/core/contents/sections/configure.zcml +18 -0
- imio/smartweb/core/contents/sections/contact/content.py +2 -2
- imio/smartweb/core/contents/sections/contact/macros.pt +28 -3
- imio/smartweb/core/contents/sections/contact/utils.py +2 -0
- imio/smartweb/core/contents/sections/contact/view.py +28 -12
- imio/smartweb/core/contents/sections/events/content.py +12 -4
- imio/smartweb/core/contents/sections/events/view.py +20 -2
- imio/smartweb/core/contents/sections/external_content/view.pt +4 -4
- imio/smartweb/core/contents/sections/external_content/views.py +6 -4
- imio/smartweb/core/contents/sections/files/content.py +7 -1
- imio/smartweb/core/contents/sections/files/view.py +43 -12
- imio/smartweb/core/contents/sections/links/view.py +5 -0
- imio/smartweb/core/contents/sections/macros.pt +26 -0
- imio/smartweb/core/contents/sections/news/content.py +11 -3
- imio/smartweb/core/contents/sections/news/view.py +20 -2
- imio/smartweb/core/contents/sections/text/views.py +2 -0
- imio/smartweb/core/contents/sections/views.py +73 -10
- imio/smartweb/core/interfaces.py +4 -0
- imio/smartweb/core/profiles/default/metadata.xml +1 -1
- imio/smartweb/core/profiles/default/taxonomies/page_category.xml +16 -0
- imio/smartweb/core/profiles/default/taxonomies/procedure_category.xml +26 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.EventsView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.NewsView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.Publication.xml +38 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionEvents.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionFiles.xml +2 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionNews.xml +1 -0
- imio/smartweb/core/profiles/default/types.xml +1 -0
- imio/smartweb/core/profiles/icons/basic/registry.xml +120 -0
- imio/smartweb/core/rest/authentic_sources.py +17 -2
- imio/smartweb/core/subscribers.py +48 -0
- imio/smartweb/core/subscribers.zcml +12 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_institutions.json +60 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_publication.json +105 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_publications.json +270 -0
- imio/smartweb/core/tests/resources/json_rest_events.json +6 -2
- imio/smartweb/core/tests/resources/json_rest_news.json +2 -2
- imio/smartweb/core/tests/resources/json_rest_specific_events.json +1 -1
- imio/smartweb/core/tests/test_htmx_in_sections.py +131 -0
- imio/smartweb/core/tests/test_iadeliberations.py +136 -0
- imio/smartweb/core/tests/test_icons.py +1 -1
- imio/smartweb/core/tests/test_rest.py +58 -17
- imio/smartweb/core/tests/test_section_contact.py +42 -10
- imio/smartweb/core/tests/test_section_events.py +28 -5
- imio/smartweb/core/tests/test_section_external_content.py +28 -2
- imio/smartweb/core/tests/test_section_news.py +30 -8
- imio/smartweb/core/tests/test_sections.py +17 -0
- imio/smartweb/core/tests/test_vocabularies.py +60 -3
- imio/smartweb/core/tests/test_vocabulary.py +43 -0
- imio/smartweb/core/upgrades/configure.zcml +108 -0
- imio/smartweb/core/upgrades/profiles/1055_to_1056/types/imio.smartweb.SectionFiles.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.EventsView.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.NewsView.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionEvents.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionNews.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.cfg +9 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.xml +73 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.cfg +9 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.xml +118 -0
- imio/smartweb/core/upgrades/profiles/1058_to_1059/registry/linkedin-icon.xml +126 -0
- imio/smartweb/core/upgrades/profiles/1059_to_1060/registry/iadeliberation.xml +9 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.Publication.xml +38 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.SectionFiles.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types.xml +4 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/workflows.xml +6 -0
- imio/smartweb/core/utils.py +33 -2
- imio/smartweb/core/viewlets/configure.zcml +23 -1
- imio/smartweb/core/viewlets/footer.pt +5 -0
- imio/smartweb/core/viewlets/footer.py +5 -0
- imio/smartweb/core/viewlets/htmx.py +15 -0
- imio/smartweb/core/viewlets/htmx_js_header.pt +64 -0
- imio/smartweb/core/viewlets/ogptags.py +4 -3
- imio/smartweb/core/viewlets/social.py +23 -0
- imio/smartweb/core/vocabularies.py +65 -3
- imio/smartweb/core/vocabularies.zcml +18 -0
- imio/smartweb/core/webcomponents/build/1c1605a5fe9a2b10a88f.png +1 -0
- imio/smartweb/core/webcomponents/build/524db40e119aa11f4478.png +1 -0
- imio/smartweb/core/webcomponents/build/57d3b7cb1ab874660b39.svg +1 -0
- imio/smartweb/core/webcomponents/build/6cf03871df23ed2ee8b3.png +1 -0
- imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/884.smartweb-webcomponents-compiled.css +1 -0
- imio/smartweb/core/webcomponents/build/css/919.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +10 -8
- imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +2 -1
- imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js.LICENSE.txt → 373.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -4
- imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/499.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/{674.smartweb-webcomponents-compiled.js.LICENSE.txt → 499.smartweb-webcomponents-compiled.js.LICENSE.txt} +1 -8
- imio/smartweb/core/webcomponents/build/js/799.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/824.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js.LICENSE.txt +32 -0
- imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -0
- imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js → 963.smartweb-webcomponents-compiled.js} +2 -2
- imio/smartweb/core/webcomponents/build/js/963.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -0
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js.LICENSE.txt +11 -14
- imio/smartweb/core/webcomponents/package.json +42 -40
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +146 -79
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +415 -351
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +95 -62
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +328 -168
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +21 -4
- imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +213 -100
- imio/smartweb/core/webcomponents/src/components/Annuaire/index.js +1 -1
- imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +76 -33
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +604 -377
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +29 -4
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +162 -88
- imio/smartweb/core/webcomponents/src/components/Events/Events.scss +496 -378
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +259 -91
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -55
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +68 -17
- imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
- imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +229 -0
- imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
- imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
- imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +139 -83
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +133 -67
- imio/smartweb/core/webcomponents/src/components/News/News.scss +170 -127
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +76 -44
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +261 -188
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +48 -9
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +21 -10
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +21 -10
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +8 -9
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +7 -6
- imio/smartweb/core/webcomponents/src/components/Search/Search.scss +115 -96
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +12 -3
- imio/smartweb/core/webcomponents/src/components/Search/index.js +1 -1
- imio/smartweb/core/webcomponents/src/hooks/ScrollContext.jsx +3 -0
- imio/smartweb/core/webcomponents/src/hooks/useAxios.js +3 -3
- imio/smartweb/core/webcomponents/src/hooks/useFilterQuery.js +1 -2
- imio/smartweb/core/webcomponents/src/index.scss +255 -211
- imio/smartweb/core/webcomponents/src/utils/Map.jsx +26 -19
- imio/smartweb/core/webcomponents/src/utils/Map.scss +2 -2
- imio/smartweb/core/webcomponents/src/utils/translation.js +129 -9
- imio.smartweb.core-1.2.79-py3.8-nspkg.pth +2 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/METADATA +413 -10
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/RECORD +206 -160
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/WHEEL +1 -1
- imio/smartweb/core/webcomponents/build/assets/location-bla.1423bcce16ddcb21141430cac1428dc1.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/next-react-white.819cb069ac8eec300a9db6a7707712d6.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/next-react.17bc43ff4a6a86f4520f5782f6a89a72.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/search.57bdbf5b191499cd77514097d1c4972c.svg +0 -1
- imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/js/209.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/674.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/build/js/804.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/src/assets/facebook-news.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/location-bla.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/next-react.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/search.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/skeleton.svg +0 -1
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/download.svg +0 -1
- imio.smartweb.core-1.2.37-py3.10-nspkg.pth +0 -3
- /imio/smartweb/core/webcomponents/build/js/{209.smartweb-webcomponents-compiled.js.LICENSE.txt → 824.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.37.dist-info → imio.smartweb.core-1.2.79.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,30 @@
|
|
1
|
+
import React, { useEffect, useContext } from "react";
|
1
2
|
import EventCard from "../EventCard/EventCard";
|
2
3
|
import { Link } from "react-router-dom";
|
3
|
-
import React from "react";
|
4
4
|
import removeAccents from "remove-accents";
|
5
|
-
|
5
|
+
import { ScrollContext } from "../../../hooks/ScrollContext";
|
6
|
+
const ContactList = ({
|
7
|
+
itemsArray,
|
8
|
+
onChange,
|
9
|
+
onHover,
|
10
|
+
showCategoriesOrTopics,
|
11
|
+
contextAuthenticatedUser,
|
12
|
+
}) => {
|
13
|
+
const { scrollPos, updateScrollPos } = useContext(ScrollContext);
|
14
|
+
|
6
15
|
function handleClick(event) {
|
7
16
|
onChange(event);
|
17
|
+
updateScrollPos(window.scrollY);
|
8
18
|
}
|
9
19
|
|
10
20
|
function handleHover(event) {
|
11
21
|
onHover(event);
|
12
22
|
}
|
23
|
+
|
24
|
+
useEffect(() => {
|
25
|
+
window.scrollTo({ top: scrollPos, left: 0, behavior: "instant" });
|
26
|
+
}, [itemsArray]);
|
27
|
+
|
13
28
|
return (
|
14
29
|
<React.Fragment>
|
15
30
|
<ul className="r-result-list event-result-list">
|
@@ -25,14 +40,24 @@ const ContactList = ({ itemsArray, onChange, onHover, parentCallback }) => {
|
|
25
40
|
className="r-list-item-link"
|
26
41
|
style={{ textDecoration: "none" }}
|
27
42
|
to={{
|
28
|
-
pathname:
|
43
|
+
pathname:
|
44
|
+
"/" +
|
45
|
+
removeAccents(item.title)
|
46
|
+
.replace(/[^a-zA-Z ]/g, "")
|
47
|
+
.replace(/\s/g, "-")
|
48
|
+
.toLowerCase(),
|
29
49
|
search: `?u=${item.UID}`,
|
30
50
|
state: {
|
31
51
|
idItem: item.UID,
|
32
52
|
},
|
33
53
|
}}
|
34
54
|
></Link>
|
35
|
-
<EventCard
|
55
|
+
<EventCard
|
56
|
+
item={item}
|
57
|
+
showCategoriesOrTopics={showCategoriesOrTopics}
|
58
|
+
key={item.created}
|
59
|
+
contextAuthenticatedUser={contextAuthenticatedUser}
|
60
|
+
/>
|
36
61
|
</li>
|
37
62
|
))}
|
38
63
|
</ul>
|
@@ -1,38 +1,57 @@
|
|
1
|
-
import React, { useEffect, useState, useRef } from "react";
|
2
|
-
import { BrowserRouter
|
1
|
+
import React, { useEffect, useState, useContext, useRef } from "react";
|
2
|
+
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
3
|
+
import { ScrollContext } from "../../hooks/ScrollContext";
|
3
4
|
import Filters from "./Filters/Filter";
|
4
5
|
import EventContent from "./EventContent/EventContent";
|
5
6
|
import EventList from "./EventList/EventList";
|
6
7
|
import Map from "../../utils/Map";
|
7
8
|
import useAxios from "../../hooks/useAxios";
|
8
9
|
import "./Events.scss";
|
10
|
+
import "../Filters/MainFilter.scss";
|
9
11
|
import useFilterQuery from "../../hooks/useFilterQuery";
|
10
12
|
import { Provider, Translate } from "react-translated";
|
11
|
-
import translation from
|
13
|
+
import translation from "../../utils/translation";
|
12
14
|
import moment from "moment";
|
15
|
+
import queryString from "query-string";
|
13
16
|
|
14
17
|
export default function Events(props) {
|
18
|
+
// Utilisation de useState pour gérer la valeur du contexte
|
19
|
+
const [scrollPos, setScrollPos] = useState(0);
|
20
|
+
// Fonction pour mettre à jour la position du scroll
|
21
|
+
const updateScrollPos = (newScrollPos) => {
|
22
|
+
setScrollPos(newScrollPos);
|
23
|
+
};
|
15
24
|
return (
|
16
|
-
<
|
25
|
+
<BrowserRouter basename={props.viewPath}>
|
17
26
|
<Provider language={props.currentLanguage} translation={translation}>
|
18
|
-
<
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
27
|
+
<ScrollContext.Provider value={{ scrollPos, updateScrollPos }}>
|
28
|
+
<EventsView
|
29
|
+
queryFilterUrl={props.queryFilterUrl}
|
30
|
+
queryUrl={props.queryUrl}
|
31
|
+
proposeUrl={props.proposeUrl}
|
32
|
+
batchSize={props.batchSize}
|
33
|
+
displayMap={props.displayMap}
|
34
|
+
onlyPastEvents={props.onlyPastEvents}
|
35
|
+
language={props.currentLanguage}
|
36
|
+
showCategoriesOrTopics={props.showCategoriesOrTopics}
|
37
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
38
|
+
/>
|
39
|
+
</ScrollContext.Provider>
|
26
40
|
</Provider>
|
27
|
-
</
|
41
|
+
</BrowserRouter>
|
28
42
|
);
|
29
43
|
}
|
30
44
|
function EventsView(props) {
|
31
|
-
const queryString = require("query-string");
|
32
45
|
const { u, ...parsed } = Object.assign(
|
33
|
-
{
|
46
|
+
{
|
47
|
+
b_start: 0,
|
48
|
+
fullobjects: 1,
|
49
|
+
"event_dates.query": [moment().format("YYYY-MM-DD")],
|
50
|
+
"event_dates.range": props.onlyPastEvents === "True" ? "max" : "min",
|
51
|
+
},
|
34
52
|
queryString.parse(useFilterQuery().toString())
|
35
53
|
);
|
54
|
+
const { scrollPos, updateScrollPos } = useContext(ScrollContext);
|
36
55
|
const [itemsArray, setItemsArray] = useState([]);
|
37
56
|
const [itemsNumber, setItemsNumber] = useState([]);
|
38
57
|
const [clickId, setClickId] = useState(null);
|
@@ -88,6 +107,7 @@ function EventsView(props) {
|
|
88
107
|
|
89
108
|
// set batch
|
90
109
|
const loadMore = () => {
|
110
|
+
updateScrollPos(window.scrollY);
|
91
111
|
setBatchStart((batchStart) => batchStart + parseInt(props.batchSize));
|
92
112
|
setLoadMoreLaunch(true);
|
93
113
|
};
|
@@ -103,27 +123,32 @@ function EventsView(props) {
|
|
103
123
|
}, [batchStart]);
|
104
124
|
|
105
125
|
// filter top style
|
106
|
-
let portalHeader = document.getElementById("portal-header");
|
107
|
-
let portalHeaderHeight = portalHeader.offsetHeight;
|
108
|
-
|
109
126
|
const filterRef = useRef();
|
110
127
|
const [style, setStyle] = React.useState({ height: 0 });
|
128
|
+
const [headerHeight, setHeaderHeight] = useState(0);
|
111
129
|
useEffect(() => {
|
112
130
|
setStyle({
|
113
131
|
height: filterRef.current.clientHeight,
|
114
132
|
});
|
115
|
-
|
133
|
+
setHeaderHeight(filterRef.current.offsetTop);
|
134
|
+
}, [filterRef]);
|
116
135
|
|
117
136
|
// coditional list render
|
118
137
|
let listRender;
|
119
138
|
let MapRender;
|
120
139
|
if (itemsArray && itemsArray.length > 0) {
|
121
140
|
listRender = (
|
122
|
-
<EventList
|
141
|
+
<EventList
|
142
|
+
onChange={clickID}
|
143
|
+
itemsArray={itemsArray}
|
144
|
+
onHover={hoverID}
|
145
|
+
showCategoriesOrTopics={props.showCategoriesOrTopics}
|
146
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
147
|
+
/>
|
123
148
|
);
|
124
149
|
MapRender = (
|
125
150
|
<Map
|
126
|
-
headerHeight={style.height +
|
151
|
+
headerHeight={style.height + headerHeight}
|
127
152
|
clickId={clickId}
|
128
153
|
hoverId={hoverId}
|
129
154
|
items={itemsArray}
|
@@ -131,16 +156,32 @@ function EventsView(props) {
|
|
131
156
|
/>
|
132
157
|
);
|
133
158
|
} else if (!isLoading) {
|
134
|
-
listRender =
|
159
|
+
listRender = (
|
160
|
+
<p>
|
161
|
+
<Translate text="Aucun événement n'a été trouvé" />
|
162
|
+
</p>
|
163
|
+
);
|
135
164
|
}
|
136
|
-
|
137
|
-
|
165
|
+
const divLoader = (
|
166
|
+
<div className="lds-roller-container">
|
167
|
+
<div className="lds-roller">
|
168
|
+
<div></div>
|
169
|
+
<div></div>
|
170
|
+
<div></div>
|
171
|
+
<div></div>
|
172
|
+
<div></div>
|
173
|
+
<div></div>
|
174
|
+
<div></div>
|
175
|
+
<div></div>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
);
|
138
179
|
return (
|
139
180
|
<div className={`ref ${displayMap ? "view-map" : "no-map"}`}>
|
140
181
|
<div
|
141
182
|
className="r-result-filter-container"
|
142
183
|
ref={filterRef}
|
143
|
-
style={{ top:
|
184
|
+
style={{ top: headerHeight }}
|
144
185
|
>
|
145
186
|
<div
|
146
187
|
id="r-result-filter"
|
@@ -151,79 +192,112 @@ function EventsView(props) {
|
|
151
192
|
activeFilter={filters}
|
152
193
|
onChange={filtersChange}
|
153
194
|
language={props.language}
|
195
|
+
onlyPastEvents={props.onlyPastEvents}
|
154
196
|
/>
|
155
|
-
{props.proposeUrl &&
|
156
|
-
|
157
|
-
<
|
158
|
-
<
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
197
|
+
{props.proposeUrl && (
|
198
|
+
<div className="r-add-event">
|
199
|
+
<a target="_blank" href={props.proposeUrl}>
|
200
|
+
<Translate text="Proposer un événement" />
|
201
|
+
<svg
|
202
|
+
xmlns="http://www.w3.org/2000/svg"
|
203
|
+
width="16"
|
204
|
+
height="16"
|
205
|
+
fill="currentColor"
|
206
|
+
className="bi bi-plus-circle"
|
207
|
+
viewBox="0 0 16 16"
|
208
|
+
>
|
209
|
+
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
210
|
+
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4" />
|
211
|
+
</svg>
|
212
|
+
</a>
|
213
|
+
</div>
|
171
214
|
)}
|
172
215
|
</div>
|
173
216
|
</div>
|
174
|
-
<
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
<div className="r-
|
181
|
-
{itemsNumber
|
182
|
-
<
|
217
|
+
<Routes>
|
218
|
+
<Route
|
219
|
+
exact
|
220
|
+
path="/"
|
221
|
+
element={
|
222
|
+
<div className="r-wrapper container r-annuaire-wrapper">
|
223
|
+
<div className="r-result r-annuaire-result">
|
224
|
+
{itemsNumber > 0 ? (
|
225
|
+
<p className="r-results-numbers">
|
226
|
+
<span>{itemsNumber}</span>
|
227
|
+
{itemsNumber > 1 ? (
|
228
|
+
<Translate text="événements trouvés" />
|
229
|
+
) : (
|
230
|
+
<Translate text="événement trouvé" />
|
231
|
+
)}
|
232
|
+
</p>
|
233
|
+
) : (
|
234
|
+
<p className="r-results-numbers">
|
235
|
+
<Translate text="Aucun résultat" />
|
236
|
+
</p>
|
237
|
+
)}
|
238
|
+
<div>{listRender}</div>
|
239
|
+
<div className="r-load-more">
|
240
|
+
{itemsNumber - props.batchSize > batchStart ? (
|
241
|
+
<div>
|
242
|
+
<span className="no-more-result">
|
243
|
+
{isLoading ? divLoader : ""}
|
244
|
+
</span>
|
245
|
+
<button onClick={loadMore} className="btn-grad">
|
246
|
+
{isLoading ? (
|
247
|
+
<Translate text="Chargement..." />
|
248
|
+
) : (
|
249
|
+
<Translate text="Plus de résultats" />
|
250
|
+
)}
|
251
|
+
</button>
|
252
|
+
</div>
|
253
|
+
) : (
|
183
254
|
<span className="no-more-result">
|
184
255
|
{isLoading ? divLoader : ""}
|
185
256
|
</span>
|
186
|
-
|
187
|
-
|
188
|
-
</button>
|
189
|
-
</div>
|
190
|
-
) : (
|
191
|
-
<span className="no-more-result">
|
192
|
-
{isLoading ? divLoader : ""}
|
193
|
-
</span>
|
194
|
-
)}
|
257
|
+
)}
|
258
|
+
</div>
|
195
259
|
</div>
|
260
|
+
{displayMap && (
|
261
|
+
<div
|
262
|
+
className="r-map annuaire-map"
|
263
|
+
style={{
|
264
|
+
top: style.height + headerHeight,
|
265
|
+
height: "calc(100vh-" + style.height + headerHeight,
|
266
|
+
}}
|
267
|
+
>
|
268
|
+
{MapRender}
|
269
|
+
</div>
|
270
|
+
)}
|
196
271
|
</div>
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
272
|
+
}
|
273
|
+
></Route>
|
274
|
+
<Route
|
275
|
+
path={"/:name"}
|
276
|
+
element={
|
277
|
+
<div className="r-wrapper container r-annuaire-wrapper">
|
278
|
+
<div className="r-result r-annuaire-result">
|
279
|
+
<EventContent
|
280
|
+
queryUrl={props.queryUrl}
|
281
|
+
onChange={clickID}
|
282
|
+
onlyPastEvents={props.onlyPastEvents}
|
283
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
284
|
+
/>
|
285
|
+
</div>
|
286
|
+
{displayMap && (
|
287
|
+
<div
|
288
|
+
className="r-map annuaire-map"
|
289
|
+
style={{
|
290
|
+
top: style.height + headerHeight,
|
291
|
+
height: "calc(100vh-" + style.height + headerHeight,
|
292
|
+
}}
|
293
|
+
>
|
294
|
+
{MapRender}
|
295
|
+
</div>
|
296
|
+
)}
|
222
297
|
</div>
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
</Switch>
|
298
|
+
}
|
299
|
+
></Route>
|
300
|
+
</Routes>
|
227
301
|
</div>
|
228
302
|
);
|
229
303
|
}
|