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
@@ -15,18 +15,18 @@
|
|
15
15
|
orientation_class python:images_orientation and f'display-{images_orientation}' or '';
|
16
16
|
thumb_scale view/get_thumb_scale_summary">
|
17
17
|
|
18
|
-
<
|
18
|
+
<ul class="" id="block-menu"
|
19
19
|
tal:attributes="class string:row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-xl-4 g-4 ${orientation_class}">
|
20
|
-
<
|
20
|
+
<li class="block-menu-element col" tal:repeat="item res/results">
|
21
21
|
<metal:macro use-macro="context/@@folder_macros/block" />
|
22
|
-
</
|
23
|
-
</
|
24
|
-
<
|
22
|
+
</li>
|
23
|
+
</ul>
|
24
|
+
<ul class="" id="block-quickaccess"
|
25
25
|
tal:attributes="class string:row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-xl-4 g-4 ${orientation_class}">
|
26
|
-
<
|
26
|
+
<li class="block-menu-element col" tal:repeat="item res/quick_access">
|
27
27
|
<metal:macro use-macro="context/@@folder_macros/block" />
|
28
|
-
</
|
29
|
-
</
|
28
|
+
</li>
|
29
|
+
</ul>
|
30
30
|
</tal:def>
|
31
31
|
</metal:content-core>
|
32
32
|
</metal:main>
|
@@ -17,12 +17,12 @@
|
|
17
17
|
images_orientation context/orientation | nothing;
|
18
18
|
orientation_class python:images_orientation and f'display-{images_orientation}' or ''">
|
19
19
|
|
20
|
-
<
|
20
|
+
<ul class="" id="block-menu"
|
21
21
|
tal:attributes="class string:row ${orientation_class}">
|
22
|
-
<
|
22
|
+
<li class="list-menu-element col-12" tal:repeat="item batch">
|
23
23
|
<metal:macro use-macro="context/@@folder_macros/summary" />
|
24
|
-
</
|
25
|
-
</
|
24
|
+
</li>
|
25
|
+
</ul>
|
26
26
|
|
27
27
|
</tal:def>
|
28
28
|
|
@@ -10,7 +10,8 @@ class CirkwiViewView(BrowserView):
|
|
10
10
|
|
11
11
|
def get_cirkwi_html(self):
|
12
12
|
cirkwi_widget_id = self.context.cirkwi_widget_id
|
13
|
-
|
13
|
+
cirkwi_widget_mb_key = self.context.cirkwi_widget_mb_key
|
14
|
+
url = f"{self.cirwki_api_uri}{cirkwi_widget_id}?mb_key={cirkwi_widget_mb_key}&{self.request.get('QUERY_STRING')}"
|
14
15
|
response = requests.get(url)
|
15
16
|
if response.status_code != 200:
|
16
17
|
return response.status_code
|
@@ -1,8 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
+
from imio.smartweb.core.interfaces import IHtmxViewUtils
|
3
4
|
from Products.Five.browser import BrowserView
|
5
|
+
from zope.interface import implementer
|
4
6
|
|
5
7
|
|
8
|
+
@implementer(IHtmxViewUtils)
|
6
9
|
class NoTitleView(BrowserView):
|
7
10
|
def __call__(self):
|
8
11
|
return ""
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
from Acquisition import aq_inner
|
4
4
|
from imio.smartweb.core.utils import get_scale_url
|
5
|
+
from imio.smartweb.core.interfaces import IHtmxViewUtils
|
5
6
|
from imio.smartweb.core.interfaces import IViewWithoutLeadImage
|
6
7
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
7
8
|
from Products.CMFPlone.resources import add_bundle_on_request
|
@@ -17,10 +18,11 @@ from zope.interface import implementer
|
|
17
18
|
|
18
19
|
|
19
20
|
@implementer(IViewWithoutLeadImage)
|
21
|
+
@implementer(IHtmxViewUtils)
|
20
22
|
class PagesView(FolderView):
|
21
23
|
"""Pages view"""
|
22
24
|
|
23
|
-
b_size =
|
25
|
+
b_size = 70
|
24
26
|
|
25
27
|
def __call__(self):
|
26
28
|
# get gallery sections and sections with gallery
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
from imio.smartweb.locales import SmartwebMessageFactory as _
|
4
|
+
from plone.dexterity.content import Item
|
5
|
+
from zope import schema
|
6
|
+
from zope.interface import implementer
|
7
|
+
from zope.interface import Interface
|
8
|
+
|
9
|
+
|
10
|
+
class IPublication(Interface):
|
11
|
+
""" """
|
12
|
+
|
13
|
+
linked_publication = schema.Choice(
|
14
|
+
vocabulary="imio.smartweb.vocabulary.IADeliberationsPublications",
|
15
|
+
title=_("I.A. Deliberation publication"),
|
16
|
+
required=True,
|
17
|
+
default=None,
|
18
|
+
)
|
19
|
+
|
20
|
+
|
21
|
+
@implementer(IPublication)
|
22
|
+
class Publication(Item):
|
23
|
+
"""Publication class"""
|
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
from imio.smartweb.core.utils import get_json
|
4
4
|
from plone import api
|
5
|
+
from plone.dexterity.content import Container
|
5
6
|
from plone.rest import Service
|
7
|
+
from urllib.parse import urlencode
|
8
|
+
from zope.interface import implementer
|
9
|
+
from zope.interface import Interface
|
6
10
|
|
7
11
|
import json
|
8
12
|
|
@@ -16,7 +20,7 @@ class BaseEndpoint(object):
|
|
16
20
|
self.request = request
|
17
21
|
|
18
22
|
def __call__(self):
|
19
|
-
results = get_json(self.query_url)
|
23
|
+
results = get_json(self.query_url, timeout=20)
|
20
24
|
return results
|
21
25
|
|
22
26
|
@property
|
@@ -39,26 +43,27 @@ class BaseEndpoint(object):
|
|
39
43
|
f"{item['@id']}/@@images/{field}/{scale_name}?cache_key={modified_hash}"
|
40
44
|
)
|
41
45
|
item[f"{field}_{scale}_scale"] = cached_scale_url
|
42
|
-
item[
|
43
|
-
f"{field}
|
44
|
-
|
46
|
+
item[f"{field}_full_scale"] = (
|
47
|
+
f"{item['@id']}/@@images/{field}/?cache_key={modified_hash}"
|
48
|
+
)
|
45
49
|
del item[field]
|
46
50
|
|
47
|
-
def
|
51
|
+
def construct_query_string(self, params):
|
52
|
+
params = "&".join(params)
|
48
53
|
form = self.request.form
|
49
54
|
extra_params = []
|
50
55
|
for k, v in form.items():
|
51
56
|
if isinstance(v, list):
|
52
57
|
# handles multiple metadata_fields
|
53
58
|
for value in v:
|
54
|
-
extra_params.append(
|
59
|
+
extra_params.append((k, value))
|
55
60
|
else:
|
56
|
-
extra_params.append(
|
61
|
+
extra_params.append((k, v))
|
57
62
|
current_lang = api.portal.get_current_language()[:2]
|
58
63
|
if current_lang != "fr":
|
59
|
-
extra_params.append("translated_in_{}
|
60
|
-
|
61
|
-
return params
|
64
|
+
extra_params.append(("translated_in_{}".format(current_lang), 1))
|
65
|
+
extra_params = urlencode(extra_params)
|
66
|
+
return "&".join(filter(None, [params, extra_params]))
|
62
67
|
|
63
68
|
|
64
69
|
class BaseService(Service):
|
@@ -71,3 +76,12 @@ class BaseService(Service):
|
|
71
76
|
indent=2,
|
72
77
|
separators=(", ", ": "),
|
73
78
|
)
|
79
|
+
|
80
|
+
|
81
|
+
class IRestView(Interface):
|
82
|
+
""""""
|
83
|
+
|
84
|
+
|
85
|
+
@implementer(IRestView)
|
86
|
+
class RestView(Container):
|
87
|
+
"""Shared base class for REST views contents"""
|
@@ -6,4 +6,11 @@
|
|
6
6
|
<include package=".news" />
|
7
7
|
<include package=".search" />
|
8
8
|
|
9
|
+
<adapter
|
10
|
+
for="imio.smartweb.core.contents.IRestView
|
11
|
+
zope.publisher.interfaces.http.IHTTPRequest"
|
12
|
+
provides="zope.publisher.interfaces.IPublishTraverse"
|
13
|
+
factory=".traversal.RestViewTraversable"
|
14
|
+
/>
|
15
|
+
|
9
16
|
</configure>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
+
from imio.smartweb.core.contents import RestView
|
3
4
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
4
5
|
from plone.app.z3cform.widget import SelectFieldWidget
|
5
6
|
from plone.autoform import directives
|
6
|
-
from plone.dexterity.content import Container
|
7
7
|
from plone.supermodel import model
|
8
8
|
from zope import schema
|
9
9
|
from zope.interface import implementer
|
@@ -34,5 +34,5 @@ class IDirectoryView(model.Schema):
|
|
34
34
|
|
35
35
|
|
36
36
|
@implementer(IDirectoryView)
|
37
|
-
class DirectoryView(
|
37
|
+
class DirectoryView(RestView):
|
38
38
|
"""DirectoryView class"""
|
@@ -53,8 +53,8 @@ class BaseDirectoryEndpoint(BaseEndpoint):
|
|
53
53
|
for category in self.context.selected_categories:
|
54
54
|
params.append(f"taxonomy_contact_category.query={category}")
|
55
55
|
params.append("taxonomy_contact_category.operator=or")
|
56
|
-
params = self.
|
57
|
-
url = f"{DIRECTORY_URL}/{self.remote_endpoint}?{
|
56
|
+
params = self.construct_query_string(params)
|
57
|
+
url = f"{DIRECTORY_URL}/{self.remote_endpoint}?{params}"
|
58
58
|
return url
|
59
59
|
|
60
60
|
|
@@ -10,7 +10,9 @@
|
|
10
10
|
propose-url view/propose_url;
|
11
11
|
orientation view/orientation;
|
12
12
|
current-language view/current_language;
|
13
|
-
display-map view/display_map;
|
13
|
+
display-map view/display_map;
|
14
|
+
view-path view/view_path;
|
15
|
+
context-authenticated-user view/context_authenticated_user;"></smartweb-annuaire>
|
14
16
|
</div>
|
15
17
|
</metal:main>
|
16
18
|
</body>
|
@@ -1,9 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
3
|
from imio.smartweb.core.contents.rest.view import BaseRestView
|
4
|
+
from imio.smartweb.core.interfaces import IOgpViewUtils
|
4
5
|
from plone import api
|
6
|
+
from zope.interface import implementer
|
5
7
|
|
6
8
|
|
9
|
+
@implementer(IOgpViewUtils)
|
7
10
|
class DirectoryViewView(BaseRestView):
|
8
11
|
"""DirectoryView view"""
|
9
12
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
+
from imio.smartweb.core.contents import RestView
|
3
4
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
4
5
|
from plone.autoform import directives
|
5
|
-
from plone.dexterity.content import Container
|
6
6
|
from plone.supermodel import model
|
7
7
|
from z3c.form.browser.checkbox import CheckBoxFieldWidget
|
8
8
|
from zope import schema
|
@@ -37,7 +37,20 @@ class IEventsView(model.Schema):
|
|
37
37
|
default=True,
|
38
38
|
)
|
39
39
|
|
40
|
+
display_agendas_titles = schema.Bool(
|
41
|
+
title=_("Display agendas titles"),
|
42
|
+
description=_("If checked, display agendas titles"),
|
43
|
+
required=False,
|
44
|
+
)
|
45
|
+
|
46
|
+
only_past_events = schema.Bool(
|
47
|
+
title=_("Display only past events"),
|
48
|
+
description=_("If selected, only past events will be displayed"),
|
49
|
+
required=False,
|
50
|
+
default=False,
|
51
|
+
)
|
52
|
+
|
40
53
|
|
41
54
|
@implementer(IEventsView)
|
42
|
-
class EventsView(
|
55
|
+
class EventsView(RestView):
|
43
56
|
"""EventsView class"""
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
-
from datetime import date
|
4
3
|
from imio.smartweb.core.config import EVENTS_URL
|
5
4
|
from imio.smartweb.core.contents.rest.base import BaseEndpoint
|
6
5
|
from imio.smartweb.core.contents.rest.base import BaseService
|
@@ -14,7 +13,7 @@ from zope.interface import Interface
|
|
14
13
|
class BaseEventsEndpoint(BaseEndpoint):
|
15
14
|
def __call__(self):
|
16
15
|
results = super(BaseEventsEndpoint, self).__call__()
|
17
|
-
if not results.get("items"):
|
16
|
+
if not results or not results.get("items"):
|
18
17
|
return results
|
19
18
|
orientation = self.context.orientation
|
20
19
|
for result in results["items"]:
|
@@ -33,17 +32,16 @@ class BaseEventsEndpoint(BaseEndpoint):
|
|
33
32
|
|
34
33
|
@property
|
35
34
|
def query_url(self):
|
36
|
-
today = date.today().isoformat()
|
37
35
|
params = [
|
38
36
|
"selected_agendas={}".format(self.context.selected_agenda),
|
39
37
|
"metadata_fields=category",
|
38
|
+
"metadata_fields=local_category",
|
39
|
+
"metadata_fields=container_uid",
|
40
40
|
"metadata_fields=topics",
|
41
41
|
"metadata_fields=start",
|
42
42
|
"metadata_fields=end",
|
43
43
|
"metadata_fields=has_leadimage",
|
44
44
|
"metadata_fields=UID",
|
45
|
-
"event_dates.query={}".format(today),
|
46
|
-
"event_dates.range=min",
|
47
45
|
"sort_on=event_dates",
|
48
46
|
"fullobjects=1",
|
49
47
|
"b_size={}".format(self.context.nb_results),
|
@@ -51,8 +49,8 @@ class BaseEventsEndpoint(BaseEndpoint):
|
|
51
49
|
if self.context.selected_event_types is not None:
|
52
50
|
for event_type in self.context.selected_event_types:
|
53
51
|
params.append(f"event_type={event_type}")
|
54
|
-
params = self.
|
55
|
-
url = f"{EVENTS_URL}/{self.remote_endpoint}?{
|
52
|
+
params = self.construct_query_string(params)
|
53
|
+
url = f"{EVENTS_URL}/{self.remote_endpoint}?{params}"
|
56
54
|
return url
|
57
55
|
|
58
56
|
|
@@ -11,7 +11,12 @@
|
|
11
11
|
propose-url view/propose_url;
|
12
12
|
orientation view/orientation;
|
13
13
|
current-language view/current_language;
|
14
|
-
display-map view/display_map;
|
14
|
+
display-map view/display_map;
|
15
|
+
only-past-events view/only_past_events;
|
16
|
+
view-path view/view_path;
|
17
|
+
display_agendas_titles view/display_agendas_titles;
|
18
|
+
show-categories-or-topics view/show_categories_or_topics;
|
19
|
+
context-authenticated-user view/context_authenticated_user;"></smartweb-events>
|
15
20
|
</div>
|
16
21
|
</metal:main>
|
17
22
|
</body>
|
@@ -1,9 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
3
|
from imio.smartweb.core.contents.rest.view import BaseRestView
|
4
|
+
from imio.smartweb.core.interfaces import IOgpViewUtils
|
4
5
|
from plone import api
|
6
|
+
from zope.interface import implementer
|
5
7
|
|
6
8
|
|
9
|
+
@implementer(IOgpViewUtils)
|
7
10
|
class EventsViewView(BaseRestView):
|
8
11
|
"""EventsView view"""
|
9
12
|
|
@@ -14,3 +17,15 @@ class EventsViewView(BaseRestView):
|
|
14
17
|
@property
|
15
18
|
def display_map(self):
|
16
19
|
return self.context.display_map
|
20
|
+
|
21
|
+
@property
|
22
|
+
def only_past_events(self):
|
23
|
+
return self.context.only_past_events
|
24
|
+
|
25
|
+
@property
|
26
|
+
def display_agendas_titles(self):
|
27
|
+
return self.context.display_agendas_titles
|
28
|
+
|
29
|
+
@property
|
30
|
+
def show_categories_or_topics(self):
|
31
|
+
return self.context.show_categories_or_topics
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
+
from imio.smartweb.core.contents import RestView
|
3
4
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
4
|
-
from plone.dexterity.content import Container
|
5
5
|
from plone.supermodel import model
|
6
6
|
from zope import schema
|
7
7
|
from zope.interface import implementer
|
@@ -21,7 +21,13 @@ class INewsView(model.Schema):
|
|
21
21
|
title=_("Number of items to display"), default=20, required=True
|
22
22
|
)
|
23
23
|
|
24
|
+
display_newsfolders_titles = schema.Bool(
|
25
|
+
title=_("Display news folders titles"),
|
26
|
+
description=_("If checked, display news folders titles"),
|
27
|
+
required=False,
|
28
|
+
)
|
29
|
+
|
24
30
|
|
25
31
|
@implementer(INewsView)
|
26
|
-
class NewsView(
|
32
|
+
class NewsView(RestView):
|
27
33
|
"""NewsView class"""
|
@@ -39,6 +39,8 @@ class BaseNewsEndpoint(BaseEndpoint):
|
|
39
39
|
"selected_news_folders={}".format(self.context.selected_news_folder),
|
40
40
|
"portal_type=imio.news.NewsItem",
|
41
41
|
"metadata_fields=category",
|
42
|
+
"metadata_fields=local_category",
|
43
|
+
"metadata_fields=container_uid",
|
42
44
|
"metadata_fields=topics",
|
43
45
|
"metadata_fields=has_leadimage",
|
44
46
|
"metadata_fields=UID",
|
@@ -47,8 +49,8 @@ class BaseNewsEndpoint(BaseEndpoint):
|
|
47
49
|
"b_size={}".format(self.context.nb_results),
|
48
50
|
"fullobjects=1",
|
49
51
|
]
|
50
|
-
params = self.
|
51
|
-
url = f"{NEWS_URL}/{self.remote_endpoint}?{
|
52
|
+
params = self.construct_query_string(params)
|
53
|
+
url = f"{NEWS_URL}/{self.remote_endpoint}?{params}"
|
52
54
|
return url
|
53
55
|
|
54
56
|
|
@@ -10,7 +10,11 @@
|
|
10
10
|
batch-size view/batch_size;
|
11
11
|
propose-url view/propose_url;
|
12
12
|
orientation view/orientation;
|
13
|
-
current-language view/current_language;
|
13
|
+
current-language view/current_language;
|
14
|
+
view-path view/view_path;
|
15
|
+
display_newsfolders_titles view/display_newsfolders_titles;
|
16
|
+
show-categories-or-topics view/show_categories_or_topics;
|
17
|
+
context-authenticated-user view/context_authenticated_user;"></smartweb-news>
|
14
18
|
</div>
|
15
19
|
</metal:main>
|
16
20
|
</body>
|
@@ -1,12 +1,23 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
3
|
from imio.smartweb.core.contents.rest.view import BaseRestView
|
4
|
+
from imio.smartweb.core.interfaces import IOgpViewUtils
|
4
5
|
from plone import api
|
6
|
+
from zope.interface import implementer
|
5
7
|
|
6
8
|
|
9
|
+
@implementer(IOgpViewUtils)
|
7
10
|
class NewsViewView(BaseRestView):
|
8
11
|
"""NewsView view"""
|
9
12
|
|
10
13
|
@property
|
11
14
|
def propose_url(self):
|
12
15
|
return api.portal.get_registry_record("smartweb.propose_news_url")
|
16
|
+
|
17
|
+
@property
|
18
|
+
def display_newsfolders_titles(self):
|
19
|
+
return self.context.display_newsfolders_titles
|
20
|
+
|
21
|
+
@property
|
22
|
+
def show_categories_or_topics(self):
|
23
|
+
return self.context.show_categories_or_topics
|
@@ -153,15 +153,15 @@ class ExtendedSearchHandler(SearchHandler):
|
|
153
153
|
del item[fname]
|
154
154
|
type_mapping = mapping[item["@type"]]
|
155
155
|
base_url = type_mapping.get(item["container_uid"], type_mapping["default"])
|
156
|
-
item["_url"] = "{base}
|
156
|
+
item["_url"] = "{base}/content?u={item_uid}".format(
|
157
157
|
base=base_url,
|
158
158
|
item_uid=item["UID"],
|
159
159
|
)
|
160
160
|
item["_source_url"] = self._get_source_url(item["path_string"], core)
|
161
161
|
modified_hash = hash_md5(item["modified"])
|
162
|
-
item[
|
163
|
-
"
|
164
|
-
|
162
|
+
item["image_url"] = (
|
163
|
+
f'{item["_source_url"]}/@@images/image/paysage_vignette?cache_key={modified_hash}'
|
164
|
+
)
|
165
165
|
return item
|
166
166
|
|
167
167
|
@property
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
from imio.smartweb.core.contents import IRestView
|
4
|
+
from ZPublisher.BaseRequest import DefaultPublishTraverse
|
5
|
+
from zope.component import adapts
|
6
|
+
from zope.publisher.interfaces.http import IHTTPRequest
|
7
|
+
|
8
|
+
|
9
|
+
class RestViewTraversable(DefaultPublishTraverse):
|
10
|
+
""" """
|
11
|
+
|
12
|
+
adapts(IRestView, IHTTPRequest)
|
13
|
+
|
14
|
+
def publishTraverse(self, request, name):
|
15
|
+
if "u" in self.request.form and name != "view":
|
16
|
+
return self.context
|
17
|
+
|
18
|
+
return super(RestViewTraversable, self).publishTraverse(request, name)
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# # -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
from imio.smartweb.core.config import DIRECTORY_URL
|
4
|
+
from imio.smartweb.core.config import EVENTS_URL
|
5
|
+
from imio.smartweb.core.config import NEWS_URL
|
6
|
+
from imio.smartweb.core.utils import get_wca_token
|
7
|
+
from plone.memoize import ram
|
8
|
+
from time import time
|
9
|
+
from zope.component import getUtility
|
10
|
+
from zope.schema.interfaces import IVocabularyFactory
|
11
|
+
|
12
|
+
import json
|
13
|
+
import os
|
14
|
+
import requests
|
15
|
+
|
16
|
+
|
17
|
+
def get_entity_id(vocabulary_name, uid):
|
18
|
+
vocabulary = getUtility(IVocabularyFactory, name=vocabulary_name)()
|
19
|
+
for term in vocabulary:
|
20
|
+
if term.token == uid:
|
21
|
+
return term.title or term.id
|
22
|
+
return None
|
23
|
+
|
24
|
+
|
25
|
+
def get_auth_sources_response(
|
26
|
+
sources_name, entity_id, wf_status=["published"], time_to_cache=60
|
27
|
+
):
|
28
|
+
"""_summary_
|
29
|
+
|
30
|
+
Args:
|
31
|
+
sources_name (_type_): 3 values are possible: "directory", "news", "events"
|
32
|
+
entity_id (_type_): _description_
|
33
|
+
|
34
|
+
Returns:
|
35
|
+
_type_: json response
|
36
|
+
"""
|
37
|
+
url = ""
|
38
|
+
if sources_name == "directory":
|
39
|
+
url = DIRECTORY_URL
|
40
|
+
portaltype = "imio.directory.Contact"
|
41
|
+
client_id_varname = "RESTAPI_DIRECTORY_CLIENT_ID"
|
42
|
+
client_secret_varname = "RESTAPI_DIRECTORY_CLIENT_SECRET"
|
43
|
+
elif sources_name == "events":
|
44
|
+
url = EVENTS_URL
|
45
|
+
portaltype = "imio.events.Event"
|
46
|
+
client_id_varname = "RESTAPI_EVENTS_CLIENT_ID"
|
47
|
+
client_secret_varname = "RESTAPI_EVENTS_CLIENT_SECRET"
|
48
|
+
elif sources_name == "news":
|
49
|
+
url = NEWS_URL
|
50
|
+
portaltype = "imio.news.NewsItem"
|
51
|
+
client_id_varname = "RESTAPI_NEWS_CLIENT_ID"
|
52
|
+
client_secret_varname = "RESTAPI_NEWS_CLIENT_SECRET"
|
53
|
+
|
54
|
+
payload = {
|
55
|
+
"query": [
|
56
|
+
{
|
57
|
+
"i": "portal_type",
|
58
|
+
"o": "plone.app.querystring.operation.selection.is",
|
59
|
+
"v": [portaltype],
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"i": "path",
|
63
|
+
"o": "plone.app.querystring.operation.string.absolutePath",
|
64
|
+
"v": f"/{entity_id}",
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"i": "review_state",
|
68
|
+
"o": "plone.app.querystring.operation.selection.any",
|
69
|
+
"v": wf_status,
|
70
|
+
},
|
71
|
+
],
|
72
|
+
"metadata_fields": ["title", "modified"],
|
73
|
+
"sort_on": "effective",
|
74
|
+
"sort_order": "descending",
|
75
|
+
"fullobjects": True,
|
76
|
+
"b_start": 0,
|
77
|
+
"b_size": 4000,
|
78
|
+
}
|
79
|
+
client_id = os.environ.get(client_id_varname)
|
80
|
+
client_secret = os.environ.get(client_secret_varname)
|
81
|
+
auth = get_wca_token(client_id, client_secret)
|
82
|
+
headers = {
|
83
|
+
"Accept": "application/json",
|
84
|
+
"Content-Type": "text/plain",
|
85
|
+
"Authorization": auth,
|
86
|
+
}
|
87
|
+
url = f"{url}/@querystring-search"
|
88
|
+
response = get_cached_data(url, headers, payload, time_to_cache)
|
89
|
+
return response
|
90
|
+
|
91
|
+
|
92
|
+
def _cache_key(func, url, headers, payload, time_to_cache):
|
93
|
+
return (url, time() // time_to_cache)
|
94
|
+
|
95
|
+
|
96
|
+
@ram.cache(_cache_key)
|
97
|
+
def get_cached_data(url, headers, payload, time_to_cache):
|
98
|
+
return requests.request("POST", url, headers=headers, data=json.dumps(payload))
|
@@ -3,6 +3,7 @@
|
|
3
3
|
from imio.smartweb.core.interfaces import IViewWithoutLeadImage
|
4
4
|
from plone import api
|
5
5
|
from Products.Five import BrowserView
|
6
|
+
from urllib.parse import urlsplit
|
6
7
|
from zope.interface import implementer
|
7
8
|
|
8
9
|
|
@@ -29,3 +30,13 @@ class BaseRestView(BrowserView):
|
|
29
30
|
@property
|
30
31
|
def current_language(self):
|
31
32
|
return api.portal.get_current_language()[:2]
|
33
|
+
|
34
|
+
@property
|
35
|
+
def context_authenticated_user(self):
|
36
|
+
return api.user.is_anonymous()
|
37
|
+
|
38
|
+
@property
|
39
|
+
def view_path(self):
|
40
|
+
url = self.context.absolute_url()
|
41
|
+
parsed = urlsplit(url)
|
42
|
+
return url.replace(f"{parsed.scheme}://{parsed.netloc}", "")
|