imio.smartweb.core 1.2.12__py3-none-any.whl → 1.2.68__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/configure.zcml +41 -1
- imio/smartweb/core/browser/controlpanel.py +41 -0
- imio/smartweb/core/browser/dashboards/configure.zcml +0 -2
- imio/smartweb/core/browser/dashboards/plausible.py +4 -4
- imio/smartweb/core/browser/faceted/block_view.pt +4 -4
- imio/smartweb/core/browser/faceted/summary_view.pt +4 -4
- imio/smartweb/core/browser/forms.py +3 -3
- imio/smartweb/core/browser/redirect_to_main_react_view.py +52 -0
- imio/smartweb/core/browser/search/search.pt +2 -1
- imio/smartweb/core/browser/search/search.py +4 -0
- imio/smartweb/core/browser/sitemap.py +148 -0
- imio/smartweb/core/browser/static/icons/action-delete.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-e-guichet.svg +1 -1
- imio/smartweb/core/browser/static/icons/action-email.svg +1 -1
- imio/smartweb/core/browser/static/icons/action-engagement-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/action-engagement.svg +1 -1
- imio/smartweb/core/browser/static/icons/action-nous-contacter.svg +1 -1
- imio/smartweb/core/browser/static/icons/action-nous-rejoindre.svg +2 -1
- imio/smartweb/core/browser/static/icons/action-organiser-un-evenement.svg +1 -1
- imio/smartweb/core/browser/static/icons/action-panneaux.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-signaler-un-probleme.svg +1 -1
- imio/smartweb/core/browser/static/icons/action-voir-plan.svg +1 -1
- imio/smartweb/core/browser/static/icons/action-vote.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-associations.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-attention.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-avis-et-enquetes.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-cinema.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-commerce.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-concert.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-culture.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-demarches.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-enfance.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-enseignement.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-environnement-gestion-des-dechets.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-exposition.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-horaires.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-infos-travaux-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-infos-travaux.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-mandataires.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-mobilite.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-mon-dossier.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-nature.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-parc-de-stationnement.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-parcs-a-conteneurs.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-parcs-et-jardins.svg +1 -1
- 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-primes.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-sport-courir.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-sport-natation.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-sport-velo.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-tourisme.svg +1 -1
- imio/smartweb/core/browser/static/icons/organisation-academie-musique.svg +1 -1
- imio/smartweb/core/browser/static/icons/organisation-centre-sportif.svg +1 -1
- imio/smartweb/core/browser/static/icons/organisation-cpas.svg +1 -1
- imio/smartweb/core/browser/static/icons/organisation-ecole-des-arts.svg +1 -1
- imio/smartweb/core/browser/static/icons/organisation-ecole-sac.svg +4 -0
- imio/smartweb/core/browser/static/icons/organisation-ecole.svg +1 -1
- imio/smartweb/core/browser/static/icons/organisation-mobilite.svg +1 -1
- 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-facebook.svg +1 -1
- imio/smartweb/core/browser/static/icons/reseausocial-linkedin.svg +3 -0
- imio/smartweb/core/browser/static/icons/reseausocial-twitter.svg +3 -13
- imio/smartweb/core/browser/static/icons/reseausocial-vimeo.svg +1 -1
- imio/smartweb/core/browser/static/icons/reseausocial-youtube.svg +1 -1
- imio/smartweb/core/browser/static/icons/vue-actualites.svg +1 -1
- imio/smartweb/core/browser/static/icons/vue-agenda.svg +1 -1
- imio/smartweb/core/browser/static/icons/vue-annuaire.svg +1 -1
- imio/smartweb/core/browser/static/smartweb-edit-compiled.css +1 -1
- imio/smartweb/core/browser/static/smartweb-edit-compiled.js +1 -1
- imio/smartweb/core/browser/static/smartweb-view-compiled.css +1 -1
- imio/smartweb/core/browser/static/smartweb-view-compiled.js +1 -1
- imio/smartweb/core/browser/static/src/edit.js +5 -0
- imio/smartweb/core/browser/static/src/edit.less +42 -0
- imio/smartweb/core/browser/static/src/view.js +11 -0
- imio/smartweb/core/browser/static/src/view.less +4 -0
- imio/smartweb/core/browser/utils.py +5 -32
- imio/smartweb/core/browser/vocabulary.py +40 -0
- imio/smartweb/core/contents/__init__.py +4 -0
- imio/smartweb/core/contents/configure.zcml +1 -0
- imio/smartweb/core/contents/cropping.py +1 -1
- 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/portal_page/view.py +3 -0
- imio/smartweb/core/contents/pages/views.py +3 -1
- 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 +24 -10
- imio/smartweb/core/contents/rest/configure.zcml +7 -0
- imio/smartweb/core/contents/rest/directory/content.py +2 -2
- imio/smartweb/core/contents/rest/directory/endpoint.py +2 -2
- imio/smartweb/core/contents/rest/directory/view.pt +3 -1
- imio/smartweb/core/contents/rest/directory/view.py +3 -0
- imio/smartweb/core/contents/rest/events/content.py +15 -2
- imio/smartweb/core/contents/rest/events/endpoint.py +5 -7
- imio/smartweb/core/contents/rest/events/view.pt +6 -1
- imio/smartweb/core/contents/rest/events/view.py +15 -0
- imio/smartweb/core/contents/rest/news/content.py +8 -2
- imio/smartweb/core/contents/rest/news/endpoint.py +4 -2
- imio/smartweb/core/contents/rest/news/view.pt +5 -1
- imio/smartweb/core/contents/rest/news/view.py +11 -0
- imio/smartweb/core/contents/rest/search/endpoint.py +4 -4
- imio/smartweb/core/contents/rest/traversal.py +18 -0
- imio/smartweb/core/contents/rest/utils.py +98 -0
- imio/smartweb/core/contents/rest/view.py +11 -0
- imio/smartweb/core/contents/sections/common_templates/carousel.pt +6 -2
- imio/smartweb/core/contents/sections/common_templates/table.pt +22 -8
- 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/utils.py +2 -154
- 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/configure.zcml +29 -0
- imio/smartweb/core/contents/sections/external_content/view.pt +25 -7
- imio/smartweb/core/contents/sections/external_content/view_idelux_waste.pt +50 -0
- imio/smartweb/core/contents/sections/external_content/view_inbw_containers_affluence.pt +91 -0
- imio/smartweb/core/contents/sections/external_content/view_odwb_widget.pt +20 -0
- imio/smartweb/core/contents/sections/external_content/views.py +306 -125
- imio/smartweb/core/contents/sections/files/content.py +7 -1
- imio/smartweb/core/contents/sections/files/view.py +40 -12
- imio/smartweb/core/contents/sections/links/view.py +5 -0
- imio/smartweb/core/contents/sections/macros.pt +39 -9
- 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/view.pt +5 -4
- imio/smartweb/core/contents/sections/text/views.py +2 -0
- imio/smartweb/core/contents/sections/views.py +81 -4
- imio/smartweb/core/interfaces.py +15 -0
- imio/smartweb/core/profiles/default/actions.xml +15 -0
- imio/smartweb/core/profiles/default/diff_tool.xml +8 -0
- imio/smartweb/core/profiles/default/metadata.xml +1 -1
- imio/smartweb/core/profiles/default/registry/plone.xml +21 -4
- imio/smartweb/core/profiles/default/repositorytool.xml +1 -0
- 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/Collection.xml +13 -0
- imio/smartweb/core/profiles/default/types/File.xml +13 -0
- imio/smartweb/core/profiles/default/types/Image.xml +13 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.BlockLink.xml +5 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.CirkwiView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.DirectoryView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.EventsView.xml +2 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.Folder.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.NewsView.xml +2 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.Page.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.PortalPage.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.Procedure.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.SectionHTML.xml +0 -1
- 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/profiles/testing/types/imio.smartweb.DirectoryView.xml +11 -0
- imio/smartweb/core/profiles/testing/types/imio.smartweb.EventsView.xml +11 -0
- imio/smartweb/core/profiles/testing/types/imio.smartweb.NewsView.xml +11 -0
- imio/smartweb/core/profiles/validation/contentrules.xml +102 -0
- imio/smartweb/core/profiles.zcml +8 -0
- imio/smartweb/core/rest/authentic_sources.py +23 -11
- imio/smartweb/core/subscribers.py +24 -0
- imio/smartweb/core/subscribers.zcml +4 -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_cropping.py +4 -4
- 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_redirect_to_main_react_view.py +79 -0
- imio/smartweb/core/tests/test_rest.py +283 -22
- imio/smartweb/core/tests/test_section_contact.py +2 -2
- imio/smartweb/core/tests/test_section_events.py +28 -5
- imio/smartweb/core/tests/test_section_external_content.py +26 -25
- imio/smartweb/core/tests/test_section_news.py +30 -8
- imio/smartweb/core/tests/test_sections.py +38 -15
- imio/smartweb/core/tests/test_sitemap.py +174 -0
- imio/smartweb/core/tests/test_vocabularies.py +61 -4
- imio/smartweb/core/tests/test_vocabulary.py +43 -0
- imio/smartweb/core/tests/utils.py +15 -0
- imio/smartweb/core/upgrades/configure.zcml +180 -0
- imio/smartweb/core/upgrades/profiles/1051_to_1052/actions.xml +20 -0
- imio/smartweb/core/upgrades/profiles/1052_to_1053/diff_tool.xml +8 -0
- imio/smartweb/core/upgrades/profiles/1052_to_1053/repositorytool.xml +9 -0
- imio/smartweb/core/upgrades/profiles/1052_to_1053/types/imio.smartweb.SectionHTML.xml +14 -0
- imio/smartweb/core/upgrades/profiles/1053_to_1054/registry.xml +39 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/Collection.xml +13 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/File.xml +13 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/Image.xml +13 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.BlockLink.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.CirkwiView.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.DirectoryView.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.EventsView.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.Folder.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.NewsView.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.Page.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.PortalPage.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1054_to_1055/types/imio.smartweb.Procedure.xml +12 -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 +65 -3
- imio/smartweb/core/viewlets/configure.zcml +43 -0
- imio/smartweb/core/viewlets/external_content.py +13 -5
- 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 +59 -0
- imio/smartweb/core/viewlets/httpheaders.py +13 -0
- imio/smartweb/core/viewlets/odwb_widget_header.pt +19 -0
- imio/smartweb/core/viewlets/offcanvas.pt +2 -1
- imio/smartweb/core/viewlets/ogp_tag_header.pt +19 -0
- imio/smartweb/core/viewlets/ogptags.py +144 -0
- imio/smartweb/core/viewlets/social.py +23 -0
- imio/smartweb/core/vocabularies.py +66 -2
- 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 -0
- imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -0
- 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 -0
- imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +16 -0
- imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js.LICENSE.txt +10 -0
- imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -0
- imio/smartweb/core/webcomponents/build/js/499.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/{212.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 +2 -0
- 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 -0
- imio/smartweb/core/webcomponents/build/js/963.smartweb-webcomponents-compiled.js +2 -0
- 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 +46 -44
- imio/smartweb/core/webcomponents/src/assets/contentIcon/download.svg +1 -0
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +160 -92
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +250 -157
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +113 -81
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +394 -188
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +26 -9
- 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 +86 -0
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +615 -0
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +67 -0
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +181 -103
- imio/smartweb/core/webcomponents/src/components/Events/Events.scss +316 -182
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +275 -80
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +136 -0
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +104 -0
- imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
- imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +227 -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 +141 -74
- imio/smartweb/core/webcomponents/src/components/News/News.scss +41 -15
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +96 -0
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +309 -0
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +76 -0
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +28 -14
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +28 -14
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +51 -32
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +29 -15
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +18 -13
- imio/smartweb/core/webcomponents/src/components/Search/Search.scss +125 -105
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +19 -6
- 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 -6
- imio/smartweb/core/webcomponents/src/hooks/useFilterQuery.js +1 -2
- imio/smartweb/core/webcomponents/src/index.scss +246 -211
- imio/smartweb/core/webcomponents/src/utils/Map.jsx +159 -0
- imio/smartweb/core/webcomponents/src/{components/Annuaire/ContactMap/ContactMap.scss → utils/Map.scss} +2 -2
- imio/smartweb/core/webcomponents/src/utils/translation.js +283 -14
- imio.smartweb.core-1.2.68-py3.11-nspkg.pth +2 -0
- {imio.smartweb.core-1.2.12.dist-info → imio.smartweb.core-1.2.68.dist-info}/METADATA +548 -3
- {imio.smartweb.core-1.2.12.dist-info → imio.smartweb.core-1.2.68.dist-info}/RECORD +317 -240
- {imio.smartweb.core-1.2.12.dist-info → imio.smartweb.core-1.2.68.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/267.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/css/323.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/css/552.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/css/779.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/js/144.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/212.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/267.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/build/js/323.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/323.smartweb-webcomponents-compiled.js.LICENSE.txt +0 -1
- imio/smartweb/core/webcomponents/build/js/552.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/552.smartweb-webcomponents-compiled.js.LICENSE.txt +0 -1
- imio/smartweb/core/webcomponents/build/js/565.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/build/js/612.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/612.smartweb-webcomponents-compiled.js.LICENSE.txt +0 -1
- imio/smartweb/core/webcomponents/build/js/779.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/build/js/9.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/969.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/969.smartweb-webcomponents-compiled.js.LICENSE.txt +0 -642
- imio/smartweb/core/webcomponents/pnpm-lock.yaml +0 -7066
- 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/ContactMap/ContactMap.jsx +0 -156
- imio/smartweb/core/webcomponents/src/components/Annuaire/Skeleton/LoaderCss.jsx +0 -7
- imio/smartweb/core/webcomponents/src/components/Annuaire/Skeleton/Skeleton.jsx +0 -20
- imio/smartweb/core/webcomponents/src/components/Events/ContactCard/ContactCard.jsx +0 -49
- imio/smartweb/core/webcomponents/src/components/Events/ContactContent/ContactContent.jsx +0 -400
- imio/smartweb/core/webcomponents/src/components/Events/ContactList/ContactList.jsx +0 -42
- imio/smartweb/core/webcomponents/src/components/Events/ContactMap/ContactMap.jsx +0 -156
- imio/smartweb/core/webcomponents/src/components/Events/Skeleton/Skeleton.jsx +0 -20
- imio/smartweb/core/webcomponents/src/components/News/ContactCard/ContactCard.jsx +0 -78
- imio/smartweb/core/webcomponents/src/components/News/ContactContent/ContactContent.jsx +0 -261
- imio/smartweb/core/webcomponents/src/components/News/ContactList/ContactList.jsx +0 -37
- imio/smartweb/core/webcomponents/src/components/News/ContactMap/ContactMap.jsx +0 -127
- imio/smartweb/core/webcomponents/src/components/News/ContactMap/ContactMap.scss +0 -4
- imio/smartweb/core/webcomponents/src/components/News/Skeleton/Skeleton.jsx +0 -20
- imio/smartweb/core/webcomponents/src/components/Search/Skeleton/Skeleton.jsx +0 -20
- imio.smartweb.core-1.2.12-py3.10-nspkg.pth +0 -3
- /imio/smartweb/core/{webcomponents/src/components/Events/ContactMap/ContactMap.scss → contents/publication/__init__.py} +0 -0
- /imio/smartweb/core/webcomponents/build/js/{144.smartweb-webcomponents-compiled.js.LICENSE.txt → 799.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
- /imio/smartweb/core/webcomponents/build/js/{9.smartweb-webcomponents-compiled.js.LICENSE.txt → 824.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
- {imio.smartweb.core-1.2.12.dist-info → imio.smartweb.core-1.2.68.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.12.dist-info → imio.smartweb.core-1.2.68.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.12.dist-info → imio.smartweb.core-1.2.68.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.12.dist-info → imio.smartweb.core-1.2.68.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,23 @@
|
|
1
1
|
import React, { useEffect, useRef, useCallback, useState } from "react";
|
2
2
|
import Select from "react-select";
|
3
|
-
import {
|
3
|
+
import { useNavigate } from "react-router-dom";
|
4
4
|
import useAxios from "../../../hooks/useAxios";
|
5
|
-
import { Translator } from "react-translated";
|
5
|
+
import { Translator, Translate } from "react-translated";
|
6
|
+
import DateFilter from "../../Filters/DateFilter";
|
7
|
+
import moment from "moment";
|
8
|
+
import queryString from "query-string";
|
9
|
+
import { taxonomy_event_public } from "./../../Filters/PublicTargetData";
|
10
|
+
import { iam } from "./../../Filters/IamData";
|
11
|
+
import { menuStyles, moreFilterStyles } from "./../../Filters/SelectStyles";
|
6
12
|
|
7
13
|
function Filters(props) {
|
8
|
-
let
|
9
|
-
const queryString = require("query-string");
|
14
|
+
let navigate = useNavigate();
|
10
15
|
const [inputValues, setInputValues] = useState(props.activeFilter);
|
11
16
|
const [topicsFilter, setTopicsFilter] = useState(null);
|
12
17
|
const [categoryFilter, setCategoryFilter] = useState(null);
|
18
|
+
const [localsCategoryFilter, setLocalsCategoryFilter] = useState([]);
|
19
|
+
const [dates, setDates] = useState(null);
|
20
|
+
// Get data
|
13
21
|
const { response, error, isLoading } = useAxios({
|
14
22
|
method: "get",
|
15
23
|
url: "",
|
@@ -18,8 +26,11 @@ function Filters(props) {
|
|
18
26
|
Accept: "application/json",
|
19
27
|
},
|
20
28
|
params: inputValues,
|
29
|
+
paramsSerializer: { indexes: null },
|
21
30
|
});
|
22
31
|
|
32
|
+
|
33
|
+
// set fitlers data to state
|
23
34
|
useEffect(() => {
|
24
35
|
if (response !== null) {
|
25
36
|
const optionsTopics =
|
@@ -33,12 +44,33 @@ function Filters(props) {
|
|
33
44
|
response.category.map((d) => ({
|
34
45
|
value: d.token,
|
35
46
|
label: d.title,
|
47
|
+
queryString: "category",
|
48
|
+
}));
|
49
|
+
const optionsLocalsCategory =
|
50
|
+
response.local_category &&
|
51
|
+
response.local_category.map((d) => ({
|
52
|
+
value: d.token,
|
53
|
+
label: d.title,
|
54
|
+
queryString: "local_category",
|
36
55
|
}));
|
37
56
|
setTopicsFilter(optionsTopics);
|
38
57
|
setCategoryFilter(optionsCategory);
|
58
|
+
setLocalsCategoryFilter(optionsLocalsCategory)
|
39
59
|
}
|
40
60
|
}, [response]);
|
41
61
|
|
62
|
+
// const to group category and local category
|
63
|
+
const groupedOptions = [
|
64
|
+
{
|
65
|
+
label: <Translate text="Catégories spécifiques" />,
|
66
|
+
options: localsCategoryFilter,
|
67
|
+
},
|
68
|
+
{
|
69
|
+
label: <Translate text="Catégories" />,
|
70
|
+
options: categoryFilter,
|
71
|
+
},
|
72
|
+
];
|
73
|
+
|
42
74
|
const onChangeHandler = useCallback(({ target: { name, value } }) => {
|
43
75
|
if (value.length > 2) {
|
44
76
|
setInputValues((state) => ({ ...state, [name]: value }), []);
|
@@ -62,6 +94,29 @@ function Filters(props) {
|
|
62
94
|
});
|
63
95
|
}
|
64
96
|
});
|
97
|
+
// const onChangeCheckbox = useCallback((value, action) => {
|
98
|
+
// if (value.target.checked) {
|
99
|
+
// setInputValues((state) => ({ ...state, free_entry: true }), []);
|
100
|
+
// } else {
|
101
|
+
// setInputValues((state) => {
|
102
|
+
// const newState = { ...state };
|
103
|
+
// delete newState["free_entry"];
|
104
|
+
// return newState;
|
105
|
+
// }, []);
|
106
|
+
// }
|
107
|
+
// });
|
108
|
+
|
109
|
+
const onChangeGroupSelect = useCallback((value, action) => {
|
110
|
+
if (value) {
|
111
|
+
setInputValues((state) => ({ ...state, [value.queryString]: value.value }), []);
|
112
|
+
} else {
|
113
|
+
setInputValues((prevState) => {
|
114
|
+
const state = { ...prevState };
|
115
|
+
const { [action.removedValues[0].queryString]: remove, ...rest } = state;
|
116
|
+
return rest;
|
117
|
+
});
|
118
|
+
}
|
119
|
+
});
|
65
120
|
|
66
121
|
// make to no launch useEffect first time
|
67
122
|
const firstUpdate = useRef(true);
|
@@ -70,7 +125,7 @@ function Filters(props) {
|
|
70
125
|
firstUpdate.current = false;
|
71
126
|
return;
|
72
127
|
}
|
73
|
-
|
128
|
+
navigate({
|
74
129
|
pathname: "./",
|
75
130
|
search: queryString.stringify(inputValues),
|
76
131
|
});
|
@@ -88,88 +143,228 @@ function Filters(props) {
|
|
88
143
|
let actCategory =
|
89
144
|
categoryFilter &&
|
90
145
|
categoryFilter.filter((option) => option.value === props.activeFilter.category);
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
146
|
+
|
147
|
+
let actTarget =
|
148
|
+
taxonomy_event_public &&
|
149
|
+
taxonomy_event_public.filter((option) => option.value === props.activeFilter.topics);
|
150
|
+
|
151
|
+
let actIam = iam && iam.filter((option) => option.value === props.activeFilter.topics);
|
152
|
+
|
153
|
+
useEffect(() => {
|
154
|
+
if (dates) {
|
155
|
+
setInputValues((prevState) => {
|
156
|
+
if (dates["event_dates.query"].length > 1) {
|
157
|
+
const { "event_dates.range": _, ...rest } = dates;
|
158
|
+
const newValue = "min:max";
|
159
|
+
return { ...prevState, ...rest, "event_dates.range": newValue };
|
160
|
+
} else if (dates["event_dates.query"].every((item) => item === null)) {
|
161
|
+
return {
|
162
|
+
...prevState,
|
163
|
+
"event_dates.query": [moment().format("YYYY-MM-DD")],
|
164
|
+
"event_dates.range": "min",
|
165
|
+
};
|
166
|
+
} else {
|
167
|
+
return { ...prevState, ...dates, "event_dates.range": "min" };
|
168
|
+
}
|
169
|
+
});
|
170
|
+
}
|
171
|
+
}, [dates]);
|
172
|
+
|
113
173
|
return (
|
114
174
|
<React.Fragment>
|
115
|
-
<
|
116
|
-
|
117
|
-
|
175
|
+
<div className="react-filters-menu">
|
176
|
+
<div className="react-filters-container">
|
177
|
+
<form className="r-filter r-filter-search" onSubmit={handleSubmit}>
|
178
|
+
{/* <label>Recherche</label> */}
|
179
|
+
<div className="relative">
|
180
|
+
<Translator>
|
181
|
+
{({ translate }) => (
|
182
|
+
<input
|
183
|
+
className="input-custom-class"
|
184
|
+
name="SearchableText"
|
185
|
+
type="text"
|
186
|
+
value={inputValues.SearchableText}
|
187
|
+
onChange={onChangeHandler}
|
188
|
+
placeholder={translate({
|
189
|
+
text: "Recherche",
|
190
|
+
})}
|
191
|
+
/>
|
192
|
+
)}
|
193
|
+
</Translator>
|
194
|
+
<svg
|
195
|
+
xmlns="http://www.w3.org/2000/svg"
|
196
|
+
fill="none"
|
197
|
+
stroke="#9f9f9f"
|
198
|
+
strokeWidth="4"
|
199
|
+
aria-hidden="true"
|
200
|
+
display="block"
|
201
|
+
overflow="visible"
|
202
|
+
style={{ height: 16, width: 16 }}
|
203
|
+
viewBox="0 0 32 32"
|
204
|
+
>
|
205
|
+
<path d="M13 24a11 11 0 1 0 0-22 11 11 0 0 0 0 22zm8-3 9 9" />
|
206
|
+
</svg>
|
207
|
+
</div>
|
208
|
+
</form>
|
209
|
+
{/* More filter*/}
|
210
|
+
<button
|
211
|
+
className="more-filter-btn collapsed"
|
212
|
+
type="button"
|
213
|
+
data-bs-toggle="collapse"
|
214
|
+
data-bs-target="#collapseOne"
|
215
|
+
aria-expanded="false"
|
216
|
+
aria-controls="collapseOne"
|
217
|
+
>
|
218
|
+
<svg
|
219
|
+
xmlns="http://www.w3.org/2000/svg"
|
220
|
+
viewBox="0 0 32 32"
|
221
|
+
style={{ height: 16, width: 16 }}
|
222
|
+
fill="none"
|
223
|
+
stroke="currentColor"
|
224
|
+
strokeWidth="3"
|
225
|
+
aria-hidden="true"
|
226
|
+
display="block"
|
227
|
+
overflow="visible"
|
228
|
+
>
|
229
|
+
<path d="M7 16H3m26 0H15M29 6h-4m-8 0H3m26 20h-4M7 16a4 4 0 108 0 4 4 0 00-8 0zM17 6a4 4 0 108 0 4 4 0 00-8 0zm0 20a4 4 0 108 0 4 4 0 00-8 0zm0 0H3"></path>
|
230
|
+
</svg>
|
231
|
+
</button>
|
232
|
+
<div className="react-sep-menu"></div>
|
233
|
+
{props.onlyPastEvents === "False" && (
|
234
|
+
<div className="r-filter schedul-Filter">
|
235
|
+
<DateFilter language={props.language} setDates={setDates} />
|
236
|
+
</div>
|
237
|
+
)}
|
238
|
+
<div className="react-sep-menu"></div>
|
239
|
+
|
240
|
+
{/* <div className="r-filter top-filter facilities-Filter">
|
241
|
+
<Translator>
|
242
|
+
{({ translate }) => (
|
243
|
+
<Select
|
244
|
+
styles={menuStyles}
|
245
|
+
name={"category"}
|
246
|
+
className="select-custom-no-border library-facilities"
|
247
|
+
isClearable
|
248
|
+
onChange={onChangeHandlerSelect}
|
249
|
+
options={categoryFilter && categoryFilter}
|
250
|
+
placeholder={translate({
|
251
|
+
text: "Quoi",
|
252
|
+
})}
|
253
|
+
value={actCategory && actCategory[0]}
|
254
|
+
/>
|
255
|
+
)}
|
256
|
+
</Translator>
|
257
|
+
</div> */}
|
258
|
+
|
259
|
+
{/* test */}
|
118
260
|
<Translator>
|
119
261
|
{({ translate }) => (
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
262
|
+
<div className="r-filter top-filter facilities-Filter">
|
263
|
+
{/* <label>Catégories</label> */}
|
264
|
+
<Select
|
265
|
+
styles={menuStyles}
|
266
|
+
name={"category"}
|
267
|
+
className="select-custom-no-border library-facilities"
|
268
|
+
isClearable
|
269
|
+
onChange={onChangeGroupSelect}
|
270
|
+
options={localsCategoryFilter.length === 0 ? categoryFilter && categoryFilter :groupedOptions}
|
271
|
+
placeholder={translate({
|
272
|
+
text: "Quoi",
|
273
|
+
})}
|
274
|
+
value={actCategory && actCategory[0]}
|
275
|
+
/>
|
276
|
+
</div>
|
277
|
+
)}
|
131
278
|
</Translator>
|
132
|
-
<button type="submit"></button>
|
133
279
|
</div>
|
134
|
-
</form>
|
135
|
-
|
136
|
-
<div className="r-filter topics-Filter">
|
137
|
-
{/* <label>Thématiques</label> */}
|
138
|
-
<Translator>
|
139
|
-
{({ translate }) => (
|
140
|
-
<Select
|
141
|
-
styles={customStyles}
|
142
|
-
name={"topics"}
|
143
|
-
className="select-custom-class library-topics"
|
144
|
-
isClearable
|
145
|
-
onChange={onChangeHandlerSelect}
|
146
|
-
options={topicsFilter && topicsFilter}
|
147
|
-
placeholder={translate({
|
148
|
-
text: 'Thématiques'
|
149
|
-
})}
|
150
|
-
value={actTopi && actTopi[0]}
|
151
|
-
/>
|
152
|
-
)}
|
153
|
-
</Translator>
|
154
280
|
</div>
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
281
|
+
|
282
|
+
{/* -------------- More filter -------------- */}
|
283
|
+
|
284
|
+
<div
|
285
|
+
id="collapseOne"
|
286
|
+
className="accordion-collapse collapse more-filter-container "
|
287
|
+
aria-labelledby="headingOne"
|
288
|
+
data-bs-parent="#accordionExample"
|
289
|
+
>
|
290
|
+
<div className="accordion-body">
|
291
|
+
{/* Filtre thématique */}
|
292
|
+
<div className="r-filter collapse-filter topics-Filter">
|
293
|
+
{/* <label>Thématiques</label> */}
|
294
|
+
<Translator>
|
295
|
+
{({ translate }) => (
|
296
|
+
<Select
|
297
|
+
styles={moreFilterStyles}
|
298
|
+
name={"topics"}
|
299
|
+
className="library-topics"
|
300
|
+
isClearable
|
301
|
+
onChange={onChangeHandlerSelect}
|
302
|
+
options={topicsFilter && topicsFilter}
|
303
|
+
placeholder={translate({
|
304
|
+
text: "Thématiques",
|
305
|
+
})}
|
306
|
+
value={actTopi && actTopi[0]}
|
307
|
+
/>
|
308
|
+
)}
|
309
|
+
</Translator>
|
310
|
+
</div>
|
311
|
+
{/* Filtre Public cible */}
|
312
|
+
<div className="r-filter collapse-filter public-target-Filter">
|
313
|
+
{/* <label>Thématiques</label> */}
|
314
|
+
<Translator>
|
315
|
+
{({ translate }) => (
|
316
|
+
<Select
|
317
|
+
styles={moreFilterStyles}
|
318
|
+
name={"taxonomy_event_public"}
|
319
|
+
className="library-topics"
|
320
|
+
isClearable
|
321
|
+
onChange={onChangeHandlerSelect}
|
322
|
+
options={taxonomy_event_public && taxonomy_event_public}
|
323
|
+
placeholder={translate({
|
324
|
+
text: "Public cible",
|
325
|
+
})}
|
326
|
+
value={actTarget && actTarget[0]}
|
327
|
+
/>
|
328
|
+
)}
|
329
|
+
</Translator>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
{/* Filtre iam */}
|
333
|
+
<div className="r-filter collapse-filter iam-Filter">
|
334
|
+
{/* <label>Thématiques</label> */}
|
335
|
+
<Translator>
|
336
|
+
{({ translate }) => (
|
337
|
+
<Select
|
338
|
+
styles={moreFilterStyles}
|
339
|
+
name={"iam"}
|
340
|
+
className="library-topics"
|
341
|
+
isClearable
|
342
|
+
onChange={onChangeHandlerSelect}
|
343
|
+
options={iam && iam}
|
344
|
+
placeholder={translate({
|
345
|
+
text: "Profil",
|
346
|
+
})}
|
347
|
+
value={actIam && actIam[0]}
|
348
|
+
/>
|
349
|
+
)}
|
350
|
+
</Translator>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
{/* Filtre Gratuit */}
|
354
|
+
{/* <div className="r-filter collapse-filter free-Filter">
|
355
|
+
<div className="form-check form-switch">
|
356
|
+
<label className="form-check-label" htmlFor="flexSwitchCheckDefault">
|
357
|
+
Gratuit
|
358
|
+
</label>
|
359
|
+
<input
|
360
|
+
className="form-check-input"
|
361
|
+
onChange={onChangeCheckbox}
|
362
|
+
type="checkbox"
|
363
|
+
id="flexSwitchCheckDefault"
|
364
|
+
/>
|
365
|
+
</div>
|
366
|
+
</div> */}
|
367
|
+
</div>
|
173
368
|
</div>
|
174
369
|
</React.Fragment>
|
175
370
|
);
|
@@ -0,0 +1,136 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import DatePicker from "react-datepicker";
|
3
|
+
import "react-datepicker/dist/react-datepicker.css";
|
4
|
+
import moment from "moment";
|
5
|
+
import { Dropdown, DropdownButton } from "react-bootstrap";
|
6
|
+
import { Translate, Translator } from "react-translated";
|
7
|
+
import { nl, fr, enGB, de } from "date-fns/locale";
|
8
|
+
|
9
|
+
import "./DateFilter.scss";
|
10
|
+
|
11
|
+
const languageList = {
|
12
|
+
fr: fr,
|
13
|
+
nl: nl,
|
14
|
+
de: de,
|
15
|
+
en: enGB,
|
16
|
+
};
|
17
|
+
function DateFilter({ language, setDates }) {
|
18
|
+
const [dateRange, setDateRange] = useState([null, null]);
|
19
|
+
const [startDate, endDate] = dateRange;
|
20
|
+
const [filter, setFilter] = useState(<Translate text="Quand" />);
|
21
|
+
const [languageToLocale, setLanguageToLocale] = useState();
|
22
|
+
|
23
|
+
const handleApply = (e) => {
|
24
|
+
setDateRange(e);
|
25
|
+
const dates = e; // Remplacez ceci par votre tableau de dates
|
26
|
+
const filteredDates = dates.filter((date) => date !== null);
|
27
|
+
const formattedDates = filteredDates.map((date) => moment(date).format("YYYY-MM-DD"));
|
28
|
+
setDates({ "event_dates.query": formattedDates });
|
29
|
+
if (e.every((item) => item === null)) {
|
30
|
+
setFilter(periodTitle.all);
|
31
|
+
} else {
|
32
|
+
setFilter(periodTitle.custom);
|
33
|
+
}
|
34
|
+
};
|
35
|
+
const today = moment().format("YYYY-MM-DD");
|
36
|
+
|
37
|
+
const periodTitle = {
|
38
|
+
all: <Translate text="Toutes les dates" />,
|
39
|
+
today: <Translate text="Aujourd'hui" />,
|
40
|
+
tomorrow: <Translate text="Demain" />,
|
41
|
+
thisWeekEnd: <Translate text="Ce week-end" />,
|
42
|
+
thisWeek: <Translate text="Cette semaine" />,
|
43
|
+
thisMonth: <Translate text="Ce mois-ci" />,
|
44
|
+
custom: <Translate text="Personnalisé (Du ... au ...)" />,
|
45
|
+
};
|
46
|
+
|
47
|
+
const handleSelect = (eventKey) => {
|
48
|
+
switch (eventKey) {
|
49
|
+
case "all":
|
50
|
+
setDates({ "event_dates.query": [today] });
|
51
|
+
setFilter(periodTitle.all);
|
52
|
+
break;
|
53
|
+
case "today":
|
54
|
+
setDates({ "event_dates.query": [today, today] });
|
55
|
+
setFilter(periodTitle.today);
|
56
|
+
break;
|
57
|
+
case "tomorrow":
|
58
|
+
const tomorrow = moment().add(1, "days").format("YYYY-MM-DD");
|
59
|
+
setDates({ "event_dates.query": [tomorrow, tomorrow] });
|
60
|
+
setFilter(periodTitle.tomorrow);
|
61
|
+
break;
|
62
|
+
case "thisWeekEnd":
|
63
|
+
const startOfWeekEnd = moment().endOf("week").format("YYYY-MM-DD");
|
64
|
+
const endOfWeekEnd = moment().endOf("week").add(1, "days").format("YYYY-MM-DD");
|
65
|
+
setDates({ "event_dates.query": [startOfWeekEnd, endOfWeekEnd] });
|
66
|
+
setFilter(periodTitle.thisWeekEnd);
|
67
|
+
break;
|
68
|
+
case "thisWeek":
|
69
|
+
const endOfWeek = moment().endOf("week").add(1, "days").format("YYYY-MM-DD");
|
70
|
+
setDates({ "event_dates.query": [today, endOfWeek] });
|
71
|
+
setFilter(periodTitle.thisWeek);
|
72
|
+
break;
|
73
|
+
case "thisMonth":
|
74
|
+
const endOfMonth = moment().endOf("month").format("YYYY-MM-DD");
|
75
|
+
setDates({ "event_dates.query": [today, endOfMonth] });
|
76
|
+
setFilter(periodTitle.thisMonth);
|
77
|
+
break;
|
78
|
+
default:
|
79
|
+
break;
|
80
|
+
}
|
81
|
+
};
|
82
|
+
|
83
|
+
useState(() => {
|
84
|
+
setLanguageToLocale(languageList[language]);
|
85
|
+
}, []);
|
86
|
+
|
87
|
+
return (
|
88
|
+
<>
|
89
|
+
<div className="period-filter">
|
90
|
+
<DropdownButton
|
91
|
+
className="period-filter-toggler"
|
92
|
+
onSelect={handleSelect}
|
93
|
+
title={filter}
|
94
|
+
>
|
95
|
+
<Dropdown.Item eventKey="all">{periodTitle.all}</Dropdown.Item>
|
96
|
+
<Dropdown.Item eventKey="today">{periodTitle.today}</Dropdown.Item>
|
97
|
+
<Dropdown.Item eventKey="tomorrow">{periodTitle.tomorrow}</Dropdown.Item>
|
98
|
+
<Dropdown.Item eventKey="thisWeekEnd">{periodTitle.thisWeekEnd}</Dropdown.Item>
|
99
|
+
<Dropdown.Item eventKey="thisWeek">{periodTitle.thisWeek}</Dropdown.Item>
|
100
|
+
<Dropdown.Item eventKey="thisMonth">{periodTitle.thisMonth}</Dropdown.Item>
|
101
|
+
<div className="perdiod-filter-range">
|
102
|
+
{languageToLocale && (
|
103
|
+
<Translator>
|
104
|
+
{({ translate, language }) => (
|
105
|
+
<DatePicker
|
106
|
+
dateFormat="dd/MM/yyyy"
|
107
|
+
placeholderText={translate({
|
108
|
+
text: "Personnalisé (Du ... au ...)",
|
109
|
+
})}
|
110
|
+
selectsRange={true}
|
111
|
+
startDate={startDate}
|
112
|
+
endDate={endDate}
|
113
|
+
minDate={new Date().setDate(new Date().getDate() + 1)}
|
114
|
+
onChange={(update) => {
|
115
|
+
setDateRange(update);
|
116
|
+
if (
|
117
|
+
(update[0] !== null && update[1] !== null) ||
|
118
|
+
(update[0] == null && update[1] == null)
|
119
|
+
) {
|
120
|
+
handleApply(update);
|
121
|
+
}
|
122
|
+
}}
|
123
|
+
isClearable={true}
|
124
|
+
locale={languageToLocale}
|
125
|
+
/>
|
126
|
+
)}
|
127
|
+
</Translator>
|
128
|
+
)}
|
129
|
+
</div>
|
130
|
+
</DropdownButton>
|
131
|
+
</div>
|
132
|
+
</>
|
133
|
+
);
|
134
|
+
}
|
135
|
+
|
136
|
+
export default DateFilter;
|
@@ -0,0 +1,104 @@
|
|
1
|
+
.schedul-Filter {
|
2
|
+
width: 100%;
|
3
|
+
|
4
|
+
@media screen and (min-width:630px) {
|
5
|
+
width: auto;
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
.period-filter {
|
10
|
+
width: 100%;
|
11
|
+
|
12
|
+
@media screen and (min-width:630px) {
|
13
|
+
width: auto;
|
14
|
+
}
|
15
|
+
|
16
|
+
.period-filter-toggler {
|
17
|
+
width: 100%;
|
18
|
+
|
19
|
+
@media screen and (min-width:630px) {
|
20
|
+
width: auto;
|
21
|
+
}
|
22
|
+
|
23
|
+
&>button {
|
24
|
+
display: flex;
|
25
|
+
justify-content: center;
|
26
|
+
align-items: center;
|
27
|
+
min-width: 150px;
|
28
|
+
background: transparent;
|
29
|
+
color: hsl(0, 0%, 20%);
|
30
|
+
box-sizing: border-box;
|
31
|
+
font-weight: bold;
|
32
|
+
font-size: 14px;
|
33
|
+
letter-spacing: 1.4px;
|
34
|
+
text-align: left;
|
35
|
+
min-height: 30px;
|
36
|
+
outline: 0 !important;
|
37
|
+
position: relative;
|
38
|
+
-webkit-transition: all 100ms;
|
39
|
+
transition: all 100ms;
|
40
|
+
background-color: white;
|
41
|
+
border-color: none;
|
42
|
+
border-radius: 0;
|
43
|
+
border-width: 1px;
|
44
|
+
border: solid 1px #fff;
|
45
|
+
box-sizing: border-box;
|
46
|
+
height: 40px;
|
47
|
+
border-radius: 10px;
|
48
|
+
width: 100%;
|
49
|
+
|
50
|
+
@media screen and (min-width:630px) {
|
51
|
+
width: auto;
|
52
|
+
}
|
53
|
+
|
54
|
+
@media screen and (max-width:629px) {
|
55
|
+
background-color: transparent;
|
56
|
+
border-color: hsl(0, 0%, 70%);
|
57
|
+
color: hsl(0, 0%, 20%);
|
58
|
+
border: solid 1px #CFCFCF;
|
59
|
+
}
|
60
|
+
|
61
|
+
&:hover {
|
62
|
+
background-color: transparent;
|
63
|
+
border-color: hsl(0, 0%, 70%);
|
64
|
+
color: hsl(0, 0%, 20%);
|
65
|
+
border: solid 1px #CFCFCF;
|
66
|
+
}
|
67
|
+
|
68
|
+
&:focus,
|
69
|
+
&:active {
|
70
|
+
border-color: #2684FF !important;
|
71
|
+
background: transparent !important;
|
72
|
+
color: hsl(0, 0%, 20%) !important;
|
73
|
+
box-shadow: 0 0 0 2px #2684FF !important;
|
74
|
+
}
|
75
|
+
|
76
|
+
&:after {
|
77
|
+
content: "";
|
78
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20' width='20' viewBox='0 0 20 20' aria-hidden='true' focusable='false' fill='%23CFCFCF' class='css-tj5bde-Svg'%3E%3Cpath d='M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z'%3E%3C/path%3E%3C/svg%3E");
|
79
|
+
display: inline-block;
|
80
|
+
width: 20px;
|
81
|
+
height: 20px;
|
82
|
+
background-repeat: no-repeat;
|
83
|
+
border: inherit;
|
84
|
+
border-color: transparent;
|
85
|
+
background-position: center;
|
86
|
+
vertical-align: bottom;
|
87
|
+
margin-left: auto;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
}
|
93
|
+
|
94
|
+
.perdiod-filter-range {
|
95
|
+
padding: 5px 16px;
|
96
|
+
|
97
|
+
input {
|
98
|
+
border: solid 1px hsl(0, 0%, 42%) !important;
|
99
|
+
border-radius: 5px;
|
100
|
+
padding: 5px 9px;
|
101
|
+
color: hsl(0, 0%, 20%);
|
102
|
+
border: solid 1px hsl(0, 0%, 70%) !important;
|
103
|
+
}
|
104
|
+
}
|