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
@@ -0,0 +1,20 @@
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
|
2
|
+
xmlns:tal="http://xml.zope.org/namespaces/tal"
|
3
|
+
xmlns:metal="http://xml.zope.org/namespaces/metal"
|
4
|
+
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
|
5
|
+
lang="en"
|
6
|
+
i18n:domain="imio.smartweb">
|
7
|
+
<metal:macro define-macro="embeded_datas">
|
8
|
+
|
9
|
+
<div class="container">
|
10
|
+
<div ng-cloak ng-app="ods-widgets">
|
11
|
+
<div tal:content="structure datas"></div>
|
12
|
+
<!--script type="text/javascript">
|
13
|
+
angular.module('ods-widgets').config(function($locationProvider) {
|
14
|
+
$locationProvider.html5Mode(true);
|
15
|
+
});
|
16
|
+
</script-->
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</metal:macro>
|
20
|
+
</html>
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
from embeddify import Embedder
|
4
4
|
from embeddify import Plugin
|
5
|
+
|
6
|
+
from imio.smartweb.core.interfaces import IOdwbViewUtils
|
5
7
|
from imio.smartweb.core.contents.sections.views import SectionView
|
6
8
|
from imio.smartweb.core.interfaces import IArcgisViewUtils
|
7
9
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
@@ -11,12 +13,22 @@ from plone.app.contenttypes.behaviors.leadimage import ILeadImage
|
|
11
13
|
from Products.Five.browser import BrowserView
|
12
14
|
from zope.i18n import translate
|
13
15
|
from zope.interface import implementer
|
16
|
+
from zope.interface import Interface
|
17
|
+
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
|
14
18
|
|
15
19
|
import json
|
20
|
+
import logging
|
21
|
+
import requests
|
22
|
+
|
23
|
+
logger = logging.getLogger("imio.smartweb.core")
|
16
24
|
|
17
25
|
|
18
26
|
class ExternalContentView(SectionView):
|
19
|
-
|
27
|
+
|
28
|
+
plugin_config = {}
|
29
|
+
|
30
|
+
def __init__(self, context, request):
|
31
|
+
width = "100%"
|
20
32
|
current_lang = api.portal.get_current_language()[:2]
|
21
33
|
plugins = [
|
22
34
|
EaglebePlugin(),
|
@@ -24,10 +36,13 @@ class ExternalContentView(SectionView):
|
|
24
36
|
CognitoformPlugin(),
|
25
37
|
ArcgisPlugin(),
|
26
38
|
GiveADayPlugin(),
|
39
|
+
IdeluxWastePlugin(),
|
40
|
+
InbwContainersAffluencePlugin(),
|
41
|
+
OdwbWidgetPlugin(),
|
27
42
|
UnknowServicePlugin(),
|
28
43
|
]
|
29
|
-
extra_params =
|
30
|
-
plugin_config = {
|
44
|
+
extra_params = context.external_content_params
|
45
|
+
self.plugin_config = {
|
31
46
|
"eaglebeplugin": {"width": width},
|
32
47
|
"ellohaplugin": {
|
33
48
|
"width": width,
|
@@ -41,16 +56,39 @@ class ExternalContentView(SectionView):
|
|
41
56
|
},
|
42
57
|
"arcgisplugin": {
|
43
58
|
"width": width,
|
44
|
-
"url":
|
59
|
+
"url": context.absolute_url(),
|
45
60
|
"current_lang": current_lang,
|
46
61
|
"extra_params": extra_params,
|
47
62
|
},
|
48
63
|
"giveadayplugin": {},
|
64
|
+
"ideluxwasteplugin": {
|
65
|
+
"url": context.absolute_url(),
|
66
|
+
"extra_params": extra_params,
|
67
|
+
},
|
68
|
+
"inbwcontainersaffluenceplugin": {
|
69
|
+
"url": context.absolute_url(),
|
70
|
+
"extra_params": extra_params,
|
71
|
+
},
|
72
|
+
"odwbwidgetplugin": {
|
73
|
+
"url": context.absolute_url(),
|
74
|
+
"extra_params": extra_params,
|
75
|
+
},
|
49
76
|
"unknowserviceplugin": {"width": width, "current_lang": current_lang},
|
50
77
|
}
|
51
|
-
embedder = Embedder(plugins=plugins, plugin_config=plugin_config)
|
52
|
-
url =
|
53
|
-
|
78
|
+
embedder = Embedder(plugins=plugins, plugin_config=self.plugin_config)
|
79
|
+
url = context.external_content_url
|
80
|
+
self.plugin = embedder(url, config={"width": width})
|
81
|
+
super(ExternalContentView, self).__init__(context, request)
|
82
|
+
|
83
|
+
@property
|
84
|
+
def contents(self):
|
85
|
+
return self.plugin.contents
|
86
|
+
|
87
|
+
def display_odwb_widget_viewlet(self):
|
88
|
+
return self.plugin.is_odwb_widget_plugins
|
89
|
+
|
90
|
+
def render_viewlet(self):
|
91
|
+
return self.index()
|
54
92
|
|
55
93
|
def has_leadimage(self):
|
56
94
|
if ILeadImage.providedBy(self.context) and getattr(
|
@@ -59,161 +97,281 @@ class ExternalContentView(SectionView):
|
|
59
97
|
return True
|
60
98
|
return False
|
61
99
|
|
100
|
+
def get_plugin(self):
|
101
|
+
return self.plugin
|
102
|
+
|
103
|
+
def which_plugin(self):
|
104
|
+
if IOdwbWidgetPlugin.providedBy(self.plugin):
|
105
|
+
return "odwbwidgetplugin"
|
106
|
+
elif IIdeluxWastePlugin.providedBy(self.plugin):
|
107
|
+
return "ideluxwasteplugin"
|
108
|
+
elif IInbwContainersAffluencePlugin.providedBy(self.plugin):
|
109
|
+
return "inbwcontainersaffluenceplugin"
|
110
|
+
else:
|
111
|
+
return None
|
112
|
+
|
62
113
|
def image(self):
|
63
114
|
return f"{self.context.absolute_url()}/@@download/image"
|
64
115
|
|
65
116
|
|
66
|
-
class
|
117
|
+
class BasePlugin(Plugin):
|
118
|
+
""" """
|
119
|
+
|
120
|
+
is_odwb_widget_plugins = False
|
121
|
+
|
122
|
+
@property
|
123
|
+
def contents(self):
|
124
|
+
return ""
|
125
|
+
|
126
|
+
|
127
|
+
class EaglebePlugin(BasePlugin):
|
67
128
|
def __call__(self, parts, config={}):
|
129
|
+
self.parts = parts
|
130
|
+
self.config = config
|
131
|
+
if "app.eaglebe.com" in parts.netloc:
|
132
|
+
return self
|
68
133
|
return None
|
69
134
|
|
70
|
-
|
71
|
-
|
135
|
+
@property
|
136
|
+
def contents(self):
|
137
|
+
return f'<iframe class="eaglebe" src="{self.parts.geturl()}" scrolling="no" width="{self.config["width"]}">'
|
72
138
|
|
73
139
|
|
74
|
-
class EllohaPlugin(
|
140
|
+
class EllohaPlugin(BasePlugin):
|
75
141
|
def __call__(self, parts, config={}):
|
76
|
-
if "
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
142
|
+
if "elloha.com" in parts.netloc:
|
143
|
+
self.parts = parts
|
144
|
+
self.config = config
|
145
|
+
return self
|
146
|
+
return None
|
147
|
+
|
148
|
+
@property
|
149
|
+
def contents(self):
|
150
|
+
# sample :
|
151
|
+
# {
|
152
|
+
# "ConstellationWidgetContainer": "917c4c52-c997-4077-9135-873a0b2e0c85",
|
153
|
+
# "Idoi": "195ea849-1732-4a69-a051-e7911001cd09"
|
154
|
+
# }
|
155
|
+
current_lang = self.config["current_lang"]
|
156
|
+
extra_params = self.config["extra_params"]
|
157
|
+
error_message = _(
|
158
|
+
"With an elloha plugin, extra params must contain a dictionary with two keys : ConstellationWidgetContainer, Idoi"
|
159
|
+
)
|
160
|
+
error_message = translate(error_message, target_language=current_lang)
|
161
|
+
error_message = f'<div class="elloha elloha_error">{error_message}</div>'
|
162
|
+
|
163
|
+
if extra_params is None or extra_params[0] != "{" or extra_params[-1] != "}":
|
164
|
+
return error_message
|
165
|
+
try:
|
166
|
+
res = json.loads(extra_params.lower())
|
167
|
+
except JSONDecodeError:
|
168
|
+
return error_message
|
169
|
+
|
170
|
+
if res.get("constellationwidgetcontainer") is None or res.get("idoi") is None:
|
171
|
+
return error_message
|
172
|
+
|
173
|
+
cw1 = res.get("constellationwidgetcontainer")
|
174
|
+
cw2 = cw1.replace("-", "")
|
175
|
+
idoi = res.get("idoi")
|
176
|
+
internal_url = "https://reservation.elloha.com"
|
177
|
+
return (
|
178
|
+
f'<div class="elloha" style="position:relative;">'
|
179
|
+
f'<div id="ConstellationWidgetContainer{cw1}" '
|
180
|
+
f'style="width:100%" data-id-projet="{cw2}">...</div></div>'
|
181
|
+
f'<script type="text/javascript" src="{internal_url}/Scripts/widget-loader.min.js?v=42"></script>'
|
182
|
+
f'<script type="text/javascript">var constellationWidgetUrl{cw2}, '
|
183
|
+
f"constellationTypeModule{cw2};"
|
184
|
+
f'constellationWidgetUrl{cw2} = "{internal_url}/Widget/BookingEngine/{cw1}?idoi={idoi}&culture=fr-FR";'
|
185
|
+
f'constellationTypeModule{cw2}=1; constellationWidgetLoad("ConstellationWidgetContainer{cw1}");'
|
186
|
+
f'constellationWidgetAddEvent(window, "resize", function () {{constellationWidgetSetAppearance("ConstellationWidgetContainer{cw1}");}});</script>'
|
187
|
+
)
|
188
|
+
|
189
|
+
|
190
|
+
class CognitoformPlugin(BasePlugin):
|
191
|
+
def __call__(self, parts, config={}):
|
192
|
+
if "cognitoforms" in parts.netloc:
|
193
|
+
self.parts = parts
|
194
|
+
self.config = config
|
195
|
+
return self
|
196
|
+
return None
|
197
|
+
|
198
|
+
@property
|
199
|
+
def contents(self):
|
200
|
+
current_lang = self.config["current_lang"]
|
201
|
+
extra_params = self.config["extra_params"]
|
202
|
+
|
203
|
+
error_message = _(
|
204
|
+
"With a cognitoform plugin, extra params can be void but if you complete it you must specify : scrolling:(yes/no) and overflow:(hidden/scroll/auto)"
|
205
|
+
)
|
206
|
+
error_message = translate(error_message, target_language=current_lang)
|
207
|
+
error_message = (
|
208
|
+
f'<div class="cognitoform cognitoform_error">{error_message}</div>'
|
209
|
+
)
|
210
|
+
|
211
|
+
if extra_params is None:
|
212
|
+
return f'<iframe src="{self.parts.geturl()}" style="border: 0px none; width: {self.config["width"]}%; overflow: auto;" scrolling="yes"></iframe>'
|
213
|
+
else:
|
214
|
+
if extra_params[0] != "{" or extra_params[-1] != "}":
|
96
215
|
return error_message
|
97
216
|
try:
|
98
217
|
res = json.loads(extra_params.lower())
|
99
218
|
except JSONDecodeError:
|
100
219
|
return error_message
|
101
220
|
|
102
|
-
if (
|
103
|
-
res.get("constellationwidgetcontainer") is None
|
104
|
-
or res.get("idoi") is None
|
105
|
-
):
|
221
|
+
if res.get("overflow") is None or res.get("scrolling") is None:
|
106
222
|
return error_message
|
107
223
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
return (
|
112
|
-
f'<div class="elloha">'
|
113
|
-
f'<div id="ConstellationWidgetContainer{cw1}" '
|
114
|
-
f'style="width:100%" data-id-projet="{cw2}">...</div></div>'
|
115
|
-
f'<script type="text/javascript" src="{parts.geturl()}/Scripts/widget-loader.min.js?v=42"></script>'
|
116
|
-
f'<script type="text/javascript">var constellationWidgetUrl{cw2}, '
|
117
|
-
f"constellationTypeModule{cw2};"
|
118
|
-
f'constellationWidgetUrl{cw2} = "https://reservation.elloha.com/Widget/BookingEngine/{cw1}?idoi={idoi}&culture=fr-FR";'
|
119
|
-
f'constellationTypeModule{cw2}=1; constellationWidgetLoad("ConstellationWidgetContainer{cw1}");'
|
120
|
-
f'constellationWidgetAddEvent(window, "resize", function () {{constellationWidgetSetAppearance("ConstellationWidgetContainer{cw1}");}});</script>'
|
121
|
-
)
|
122
|
-
#
|
123
|
-
return None
|
224
|
+
overflow = res.get("overflow")
|
225
|
+
scrolling = res.get("scrolling")
|
226
|
+
return f'<iframe src="{self.parts.geturl()}" style="border: 0px none; width: {self.config["width"]}%; overflow: {overflow};" scrolling="{scrolling}"></iframe>'
|
124
227
|
|
125
228
|
|
126
|
-
class
|
229
|
+
class ArcgisPlugin(BasePlugin):
|
127
230
|
def __call__(self, parts, config={}):
|
128
|
-
if "
|
129
|
-
|
130
|
-
|
231
|
+
if "arcgis" in parts.netloc:
|
232
|
+
self.parts = parts
|
233
|
+
self.config = config
|
234
|
+
return self
|
235
|
+
return None
|
236
|
+
|
237
|
+
@property
|
238
|
+
def contents(self):
|
239
|
+
# url : https://developers.arcgis.com/
|
240
|
+
# extra_params : {"portal_item_id":"27a432b0835149e6acd3ac39d0e4349c"}
|
241
|
+
current_lang = self.config["current_lang"]
|
242
|
+
extra_params = self.config["extra_params"]
|
243
|
+
url = self.config["url"]
|
244
|
+
|
245
|
+
error_message = _(
|
246
|
+
"With arcgis plugin, extra params must contain a dictionary with one key : portal_item_id"
|
247
|
+
)
|
248
|
+
error_message = translate(error_message, target_language=current_lang)
|
249
|
+
error_message = f'<div class="arcgis arcgis_error">{error_message}</div>'
|
250
|
+
|
251
|
+
if extra_params is None or extra_params[0] != "{" or extra_params[-1] != "}":
|
252
|
+
return error_message
|
253
|
+
try:
|
254
|
+
res = json.loads(extra_params.lower())
|
255
|
+
except JSONDecodeError:
|
256
|
+
return error_message
|
257
|
+
if res.get("portal_item_id") is None:
|
258
|
+
return error_message
|
259
|
+
|
260
|
+
portal_item_id = res.get("portal_item_id")
|
261
|
+
msg = _("Consult the map")
|
262
|
+
msg = translate(msg, target_language=current_lang)
|
263
|
+
return f'<a href="{url}/view_arcgis?portal_item_id={portal_item_id}">{msg}</a>'
|
131
264
|
|
132
|
-
error_message = _(
|
133
|
-
"With a cognitoform plugin, extra params can be void but if you complete it you must specify : scrolling:(yes/no) and overflow:(hidden/scroll/auto)"
|
134
|
-
)
|
135
|
-
error_message = translate(error_message, target_language=current_lang)
|
136
|
-
error_message = (
|
137
|
-
f'<div class="cognitoform cognitoform_error">{error_message}</div>'
|
138
|
-
)
|
139
265
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
res = json.loads(extra_params.lower())
|
147
|
-
except JSONDecodeError:
|
148
|
-
return error_message
|
149
|
-
|
150
|
-
if res.get("overflow") is None or res.get("scrolling") is None:
|
151
|
-
return error_message
|
152
|
-
|
153
|
-
overflow = res.get("overflow")
|
154
|
-
scrolling = res.get("scrolling")
|
155
|
-
return f'<iframe src="{parts.geturl()}" style="border: 0px none; width: {config["width"]}%; overflow: {overflow};" scrolling="{scrolling}"></iframe>'
|
266
|
+
class GiveADayPlugin(BasePlugin):
|
267
|
+
def __call__(self, parts, config={}):
|
268
|
+
if "www.giveaday.be" in parts.netloc:
|
269
|
+
self.parts = parts
|
270
|
+
self.config = config
|
271
|
+
return self
|
156
272
|
#
|
157
273
|
return None
|
158
274
|
|
275
|
+
@property
|
276
|
+
def contents(self):
|
277
|
+
return (
|
278
|
+
'<div id="giveaday-widget"></div>'
|
279
|
+
"<script src=https://www.giveaday.be/assets/giveaday_v1.js></script>"
|
280
|
+
"<script>"
|
281
|
+
"function renderWidget() {"
|
282
|
+
'giveADayWidget.initialize("giveaday-widget", 2924, "organization", "large", "fr","#34B78F");}'
|
283
|
+
"renderWidget();"
|
284
|
+
"</script>"
|
285
|
+
)
|
159
286
|
|
160
|
-
|
287
|
+
|
288
|
+
class IIdeluxWastePlugin(Interface):
|
289
|
+
""""""
|
290
|
+
|
291
|
+
|
292
|
+
@implementer(IIdeluxWastePlugin)
|
293
|
+
class IdeluxWastePlugin(BasePlugin):
|
161
294
|
def __call__(self, parts, config={}):
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
error_message = _(
|
170
|
-
"With arcgis plugin, extra params must contain a dictionary with one key : portal_item_id"
|
171
|
-
)
|
172
|
-
error_message = translate(error_message, target_language=current_lang)
|
173
|
-
error_message = f'<div class="arcgis arcgis_error">{error_message}</div>'
|
174
|
-
|
175
|
-
if (
|
176
|
-
extra_params is None
|
177
|
-
or extra_params[0] != "{"
|
178
|
-
or extra_params[-1] != "}"
|
179
|
-
):
|
180
|
-
return error_message
|
181
|
-
try:
|
182
|
-
res = json.loads(extra_params.lower())
|
183
|
-
except JSONDecodeError:
|
184
|
-
return error_message
|
185
|
-
if res.get("portal_item_id") is None:
|
186
|
-
return error_message
|
295
|
+
# https://www.odwb.be/api/explore/v2.1/catalog/datasets/guide-de-tri1/records
|
296
|
+
if "www.odwb.be" in parts.netloc and "guide-de-tri1" in parts.path:
|
297
|
+
self.parts = parts
|
298
|
+
self.config = config
|
299
|
+
return self
|
300
|
+
return None
|
187
301
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
302
|
+
# url = config["url"]
|
303
|
+
# return (f'<a href="{url}/view_idelux_waste?portal_item_id={portal_item_id}">{msg}</a>')
|
304
|
+
@property
|
305
|
+
def contents(self):
|
306
|
+
headers = {"Accept": "application/json"}
|
307
|
+
try:
|
308
|
+
# ?limit=-1 to get all records from an odwb table.
|
309
|
+
response = requests.get(
|
310
|
+
f"{self.parts.geturl()}?limit=-1", headers=headers, timeout=5
|
193
311
|
)
|
194
|
-
|
195
|
-
|
312
|
+
self.config["extra_params"] = response.json()
|
313
|
+
return self.config["extra_params"]
|
314
|
+
|
315
|
+
except requests.exceptions.Timeout:
|
316
|
+
logger.warning(f"Timeout raised for requests : {self.url}")
|
317
|
+
return None
|
318
|
+
|
196
319
|
|
320
|
+
class IInbwContainersAffluencePlugin(Interface):
|
321
|
+
""""""
|
197
322
|
|
198
|
-
|
323
|
+
|
324
|
+
@implementer(IInbwContainersAffluencePlugin)
|
325
|
+
class InbwContainersAffluencePlugin(BasePlugin):
|
199
326
|
def __call__(self, parts, config={}):
|
200
|
-
if "www.
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
"<script>"
|
205
|
-
"function renderWidget() {"
|
206
|
-
'giveADayWidget.initialize("giveaday-widget", 2924, "organization", "large", "fr","#34B78F");}'
|
207
|
-
"renderWidget();"
|
208
|
-
"</script>"
|
209
|
-
)
|
210
|
-
#
|
327
|
+
if "www.odwb.be" in parts.netloc and "affluence" in parts.path:
|
328
|
+
self.parts = parts
|
329
|
+
self.config = config
|
330
|
+
return self
|
211
331
|
return None
|
212
332
|
|
333
|
+
@property
|
334
|
+
def contents(self):
|
335
|
+
headers = {"Accept": "application/json"}
|
336
|
+
try:
|
337
|
+
response = requests.get(
|
338
|
+
f"{self.parts.geturl()}&limit=-1", headers=headers, timeout=5
|
339
|
+
)
|
340
|
+
self.config["extra_params"] = json.dumps(response.json())
|
341
|
+
return self.config["extra_params"]
|
342
|
+
except requests.exceptions.Timeout:
|
343
|
+
logger.warning(f"Timeout raised for requests : {self.url}")
|
344
|
+
return None
|
345
|
+
|
346
|
+
|
347
|
+
class IOdwbWidgetPlugin(Interface):
|
348
|
+
""""""
|
213
349
|
|
214
|
-
|
350
|
+
|
351
|
+
@implementer(IOdwbWidgetPlugin)
|
352
|
+
class OdwbWidgetPlugin(BasePlugin):
|
215
353
|
def __call__(self, parts, config={}):
|
216
|
-
|
354
|
+
# https://static.opendatasoft.com/ods-widgets
|
355
|
+
if "static.opendatasoft.com" in parts.netloc:
|
356
|
+
self.is_odwb_widget_plugins = True
|
357
|
+
self.parts = parts
|
358
|
+
self.config = config
|
359
|
+
return self
|
360
|
+
|
361
|
+
@property
|
362
|
+
def contents(self):
|
363
|
+
return self.config["extra_params"]
|
364
|
+
|
365
|
+
|
366
|
+
class UnknowServicePlugin(BasePlugin):
|
367
|
+
def __call__(self, parts, config={}):
|
368
|
+
self.parts = parts
|
369
|
+
self.config = config
|
370
|
+
return self
|
371
|
+
|
372
|
+
@property
|
373
|
+
def contents(self):
|
374
|
+
current_lang = self.config["current_lang"]
|
217
375
|
msg = _("Unknow service")
|
218
376
|
msg = translate(msg, target_language=current_lang)
|
219
377
|
return f'<p class="unknow_service">{msg}</p>'
|
@@ -226,3 +384,26 @@ class ArcgisView(BrowserView):
|
|
226
384
|
@property
|
227
385
|
def get_portal_item_id(self):
|
228
386
|
return self.request.portal_item_id
|
387
|
+
|
388
|
+
|
389
|
+
class IdeluxWasteView(BrowserView):
|
390
|
+
|
391
|
+
def __init__(self, context, request):
|
392
|
+
""" """
|
393
|
+
|
394
|
+
|
395
|
+
class InbwContainersAffluenceView(BrowserView):
|
396
|
+
|
397
|
+
def __init__(self, context, request):
|
398
|
+
""" """
|
399
|
+
|
400
|
+
|
401
|
+
class IOdwbWidgetLayer(IDefaultBrowserLayer):
|
402
|
+
""" """
|
403
|
+
|
404
|
+
|
405
|
+
@implementer(IOdwbViewUtils, IOdwbWidgetLayer)
|
406
|
+
class OdwbWidgetView(BrowserView):
|
407
|
+
|
408
|
+
def __init__(self, context, request):
|
409
|
+
""" """
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
|
2
|
+
from imio.smartweb.core.contents import IPublication
|
3
3
|
from imio.smartweb.core.contents.sections.base import ISection
|
4
4
|
from imio.smartweb.core.contents.sections.base import Section
|
5
5
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
@@ -30,3 +30,9 @@ class SectionFiles(Section):
|
|
30
30
|
"""SectionText class"""
|
31
31
|
|
32
32
|
manage_content = True
|
33
|
+
|
34
|
+
def has_publications(self):
|
35
|
+
for item in self.items():
|
36
|
+
if IPublication.providedBy(item[1]):
|
37
|
+
return True
|
38
|
+
return False
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
|
2
|
+
from imio.smartweb.core.contents import IPublication
|
3
3
|
from imio.smartweb.core.contents.sections.views import CarouselOrTableSectionView
|
4
4
|
from imio.smartweb.core.utils import batch_results
|
5
5
|
from imio.smartweb.core.utils import get_scale_url
|
6
|
+
from plone import api
|
6
7
|
from zope.component import queryMultiAdapter
|
7
8
|
|
8
9
|
|
@@ -10,24 +11,51 @@ class FilesView(CarouselOrTableSectionView):
|
|
10
11
|
"""Files Section view"""
|
11
12
|
|
12
13
|
def items(self):
|
14
|
+
orientation = self.context.orientation
|
13
15
|
image_scale = self.image_scale
|
14
|
-
items = self.
|
16
|
+
items = super(FilesView, self).items()
|
15
17
|
results = []
|
16
18
|
for item in items:
|
17
19
|
url = item.absolute_url()
|
18
20
|
has_image = True if getattr(item.aq_base, "image", None) else False
|
19
21
|
file_view = queryMultiAdapter((item, self.request), name="file_view")
|
20
22
|
scale_url = get_scale_url(
|
21
|
-
item, self.request, "image", image_scale, orientation
|
23
|
+
item, self.request, "image", image_scale, orientation
|
22
24
|
)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
dict_item = {
|
26
|
+
"title": item.title,
|
27
|
+
"description": item.description,
|
28
|
+
"smartweb_type": item.smartweb_type,
|
29
|
+
"url": url,
|
30
|
+
"image": scale_url,
|
31
|
+
"has_image": has_image,
|
32
|
+
}
|
33
|
+
dict_item["item_infos"] = (
|
34
|
+
None if file_view is None else file_view.human_readable_size()
|
32
35
|
)
|
36
|
+
if IPublication.providedBy(item):
|
37
|
+
extra_properties = [
|
38
|
+
"linked_publication",
|
39
|
+
"publication_datetime",
|
40
|
+
"publication_url",
|
41
|
+
"publication_document_type",
|
42
|
+
"publication_attached_file",
|
43
|
+
]
|
44
|
+
dict_item = self.get_publication_extra_properties(
|
45
|
+
item, dict_item, extra_properties
|
46
|
+
)
|
47
|
+
|
48
|
+
results.append(dict_item)
|
33
49
|
return batch_results(results, self.context.nb_results_by_batch)
|
50
|
+
|
51
|
+
def retrieve_item_url(self, item):
|
52
|
+
if item.get("publication_url", None) is not None and api.user.is_anonymous():
|
53
|
+
# return "real" publication url in iadeliberation
|
54
|
+
return item.get("publication_url")
|
55
|
+
# return smartweb item url
|
56
|
+
return item.get("url")
|
57
|
+
|
58
|
+
def get_publication_extra_properties(self, item, dict_item, extra_properties):
|
59
|
+
for prop in extra_properties:
|
60
|
+
dict_item[prop] = getattr(item, prop, None)
|
61
|
+
return dict_item
|
@@ -3,6 +3,7 @@
|
|
3
3
|
from imio.smartweb.core.contents.sections.views import CarouselOrTableSectionView
|
4
4
|
from imio.smartweb.core.utils import batch_results
|
5
5
|
from imio.smartweb.core.utils import get_scale_url
|
6
|
+
from plone import api
|
6
7
|
|
7
8
|
|
8
9
|
class LinksView(CarouselOrTableSectionView):
|
@@ -15,6 +16,10 @@ class LinksView(CarouselOrTableSectionView):
|
|
15
16
|
results = []
|
16
17
|
for item in items:
|
17
18
|
url = item.absolute_url()
|
19
|
+
is_anon = api.user.is_anonymous()
|
20
|
+
if hasattr(item, "remoteUrl") and item.remoteUrl is not None and is_anon:
|
21
|
+
portal_url = api.portal.get().absolute_url()
|
22
|
+
url = item.remoteUrl.replace("${portal_url}", portal_url)
|
18
23
|
has_icon = has_image = False
|
19
24
|
if getattr(item.aq_base, "svg_icon", None):
|
20
25
|
has_icon = True
|