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
@@ -48,7 +48,8 @@
|
|
48
48
|
open_in_new_tab item/open_in_new_tab | nothing;">
|
49
49
|
<a tal:omit-tag="not: item/url"
|
50
50
|
tal:attributes="href item/url;
|
51
|
-
|
51
|
+
class item/container_id | nothing;
|
52
|
+
target python:'_blank' if (open_in_new_tab and not can_edit_sections) else ''">
|
52
53
|
<div class="swiper-image"
|
53
54
|
tal:condition="python: item_has_image and show_lead_image"
|
54
55
|
tal:attributes="style string:background-image:url(${item/image});
|
@@ -64,13 +65,16 @@
|
|
64
65
|
tal:condition="item/category | nothing">
|
65
66
|
<span tal:content="item/category" />
|
66
67
|
</div>
|
68
|
+
<div tal:condition="view/display_container_title"
|
69
|
+
class="auth_source_container_title"
|
70
|
+
tal:content="item/container_title | nothing"></div>
|
67
71
|
<div class="swiper_date"
|
68
72
|
tal:condition="context/show_items_date | nothing">
|
69
73
|
<tal:if tal:condition="item/effective | nothing">
|
70
74
|
<span i18n:translate="">Published</span>
|
71
75
|
<span class="pat-display-time"
|
72
76
|
data-pat-display-time="from-now: true"
|
73
|
-
tal:attributes="datetime item
|
77
|
+
tal:attributes="datetime python:view.datetime_format(item)"/>
|
74
78
|
</tal:if>
|
75
79
|
<tal:if tal:condition="item/event_date | nothing">
|
76
80
|
<tal:def tal:define="event_date item/event_date">
|
@@ -56,19 +56,20 @@
|
|
56
56
|
show_lead_image python:getattr(context, 'show_items_lead_image', True);
|
57
57
|
portal context/@@plone_portal_state/portal;
|
58
58
|
open_in_new_tab item/open_in_new_tab | nothing;"
|
59
|
-
|
59
|
+
tal:attributes="class string:table_display ${item/container_id | nothing} ${item/smartweb_type | nothing};"
|
60
|
+
>
|
60
61
|
<a tal:attributes="class python:'table_image no-image' if no_icon_no_image else 'table_image';
|
61
|
-
href item
|
62
|
+
href python:view.retrieve_item_url(item);
|
62
63
|
target python:'_blank' if (open_in_new_tab and not can_edit_sections) else '';">
|
63
64
|
<tal:if tal:condition="show_lead_image">
|
64
|
-
<div class="image d-block w-100"
|
65
|
+
<div class="image d-block is-icon w-100"
|
65
66
|
tal:condition="item_has_icon">
|
66
67
|
<tal:icon tal:replace="structure python:smartweb_icons.tag(item['icon'])" />
|
67
68
|
</div>
|
68
|
-
<div class="image d-block w-100"
|
69
|
+
<div class="image d-block is-image w-100"
|
69
70
|
tal:condition="python: item_has_image and not item_has_icon"
|
70
71
|
tal:attributes="style string:background-image:url(${item/image});
|
71
|
-
class python:'image d-block w-100 {}'.format('bad_scale' if item.get('bad_scale') else '')">
|
72
|
+
class python:'image d-block is-image w-100 {}'.format('bad_scale' if item.get('bad_scale') else '')">
|
72
73
|
<span tal:condition="python:not view.is_anonymous and item.get('bad_scale')"
|
73
74
|
i18n:translate="">Bad scale</span>
|
74
75
|
</div>
|
@@ -84,20 +85,26 @@
|
|
84
85
|
</div>
|
85
86
|
|
86
87
|
<div class="table_date"
|
87
|
-
tal:condition="context/show_items_date | nothing">
|
88
|
+
tal:condition="context/show_items_date | context/has_publications | nothing">
|
88
89
|
<tal:if tal:condition="item/effective | nothing">
|
89
90
|
<span i18n:translate="">Published</span>
|
90
91
|
<span class="pat-display-time"
|
91
92
|
data-pat-display-time="from-now: true"
|
92
|
-
tal:attributes="datetime item
|
93
|
+
tal:attributes="datetime python:view.datetime_format(item)"/>
|
93
94
|
</tal:if>
|
94
95
|
<tal:if tal:condition="item/event_date | nothing">
|
95
96
|
<tal:def tal:define="event_date item/event_date">
|
96
97
|
<metal:macro use-macro="context/@@macros/event_date" />
|
97
98
|
</tal:def>
|
98
99
|
</tal:if>
|
100
|
+
<tal:if tal:condition="item/publication_datetime | nothing">
|
101
|
+
<span class="publication_datetime" tal:content="python:view.datetime_format(item,'publication_datetime')"/>
|
102
|
+
</tal:if>
|
103
|
+
</div>
|
104
|
+
<div tal:condition="view/display_container_title"
|
105
|
+
class="auth_source_container_title"
|
106
|
+
tal:content="item/container_title | nothing">
|
99
107
|
</div>
|
100
|
-
|
101
108
|
<div class="table_title">
|
102
109
|
<span tal:content="item/title" />
|
103
110
|
</div>
|
@@ -111,6 +118,13 @@
|
|
111
118
|
tal:condition="item/item_infos | nothing"
|
112
119
|
tal:content="item/item_infos"/>
|
113
120
|
</a>
|
121
|
+
<!-- publication : attached file-->
|
122
|
+
<a
|
123
|
+
tal:condition="item/publication_attached_file | nothing"
|
124
|
+
tal:attributes="href item/publication_attached_file/download"
|
125
|
+
tal:content="item/publication_attached_file/filename"
|
126
|
+
target="_blank" ></a>
|
127
|
+
|
114
128
|
</div>
|
115
129
|
</li>
|
116
130
|
|
@@ -54,6 +54,24 @@
|
|
54
54
|
layer="imio.smartweb.core.interfaces.IImioSmartwebCoreLayer"
|
55
55
|
/>
|
56
56
|
|
57
|
+
<browser:page
|
58
|
+
for="*"
|
59
|
+
name="getsizes"
|
60
|
+
attribute="get_sizes"
|
61
|
+
class="imio.smartweb.core.contents.sections.views.SectionView"
|
62
|
+
permission="zope2.View"
|
63
|
+
layer="imio.smartweb.core.interfaces.IImioSmartwebCoreLayer"
|
64
|
+
/>
|
65
|
+
|
66
|
+
<browser:page
|
67
|
+
for="*"
|
68
|
+
name="savesize"
|
69
|
+
attribute="save_size"
|
70
|
+
class="imio.smartweb.core.contents.sections.views.SectionView"
|
71
|
+
permission="cmf.ModifyPortalContent"
|
72
|
+
layer="imio.smartweb.core.interfaces.IImioSmartwebCoreLayer"
|
73
|
+
/>
|
74
|
+
|
57
75
|
<subscriber
|
58
76
|
for="imio.smartweb.core.contents.ISection
|
59
77
|
zope.lifecycleevent.interfaces.IObjectAddedEvent"
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
+
from imio.smartweb.common.widgets.select import TranslatedAjaxSelectWidget
|
3
4
|
from imio.smartweb.core.contents.sections.base import ISection
|
4
5
|
from imio.smartweb.core.contents.sections.base import Section
|
5
6
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
6
|
-
from plone.app.z3cform.widget import SelectFieldWidget
|
7
7
|
from plone.autoform import directives
|
8
8
|
from plone.supermodel import model
|
9
9
|
from z3c.form.browser.checkbox import CheckBoxFieldWidget
|
@@ -16,7 +16,7 @@ class ISectionContact(ISection):
|
|
16
16
|
|
17
17
|
directives.widget(
|
18
18
|
"related_contacts",
|
19
|
-
|
19
|
+
TranslatedAjaxSelectWidget,
|
20
20
|
vocabulary="imio.smartweb.vocabulary.RemoteContacts",
|
21
21
|
pattern_options={"multiple": True},
|
22
22
|
)
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
-
from
|
4
|
-
from datetime import timedelta
|
5
|
-
from decimal import Decimal
|
3
|
+
from imio.smartweb.common.contact_utils import ContactProperties as ContactSchedule
|
6
4
|
from imio.smartweb.common.utils import rich_description
|
7
5
|
from imio.smartweb.core.utils import batch_results
|
8
6
|
from imio.smartweb.core.utils import get_json
|
@@ -10,12 +8,11 @@ from imio.smartweb.core.utils import hash_md5
|
|
10
8
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
11
9
|
from plone import api
|
12
10
|
from zope.i18n import translate
|
13
|
-
from zope.i18nmessageid import MessageFactory
|
14
11
|
|
15
12
|
import json
|
16
13
|
|
17
14
|
|
18
|
-
class ContactProperties:
|
15
|
+
class ContactProperties(ContactSchedule):
|
19
16
|
def __init__(self, json_dict, section):
|
20
17
|
self.contact = json_dict
|
21
18
|
self.context = section
|
@@ -94,18 +91,6 @@ class ContactProperties:
|
|
94
91
|
results.append(dict_item)
|
95
92
|
return batch_results(results, nb_results_by_batch)
|
96
93
|
|
97
|
-
@property
|
98
|
-
def days(self):
|
99
|
-
return (
|
100
|
-
("monday", _("Monday")),
|
101
|
-
("tuesday", _("Tuesday")),
|
102
|
-
("wednesday", _("Wednesday")),
|
103
|
-
("thursday", _("Thursday")),
|
104
|
-
("friday", _("Friday")),
|
105
|
-
("saturday", _("Saturday")),
|
106
|
-
("sunday", _("Sunday")),
|
107
|
-
)
|
108
|
-
|
109
94
|
def get_itinerary_link(self):
|
110
95
|
address_parts = [
|
111
96
|
self.contact.get("street"),
|
@@ -126,79 +111,6 @@ class ContactProperties:
|
|
126
111
|
url_type_label = url_type_id[0].upper() + url_type_id[1:]
|
127
112
|
return translate(_(url_type_label), target_language=current_lang)
|
128
113
|
|
129
|
-
def get_opening_informations(self, a_date=None):
|
130
|
-
current_date = a_date or date.today()
|
131
|
-
schedule = self.contact.get("schedule")
|
132
|
-
multi_schedule = self.contact.get("multi_schedule")
|
133
|
-
exceptional_closure = self.contact.get("exceptional_closure")
|
134
|
-
week_day = self.days[current_date.weekday()][0]
|
135
|
-
day_schedule = schedule[week_day]
|
136
|
-
for schedule_info in multi_schedule:
|
137
|
-
if schedule_info.get("dates") == []:
|
138
|
-
continue
|
139
|
-
for daterange in schedule_info.get("dates"):
|
140
|
-
min_date = datetime.strptime(
|
141
|
-
daterange.get("start_date"), "%Y-%m-%d"
|
142
|
-
).date()
|
143
|
-
max_date = datetime.strptime(
|
144
|
-
daterange.get("end_date"), "%Y-%m-%d"
|
145
|
-
).date()
|
146
|
-
if not (min_date < current_date < max_date):
|
147
|
-
week_day = week_day # Fix coverage issue with continue.
|
148
|
-
continue
|
149
|
-
day_schedule = schedule_info.get("schedule")[week_day]
|
150
|
-
|
151
|
-
for exceptional_closure_info in exceptional_closure:
|
152
|
-
exceptional_closure_date = datetime.strptime(
|
153
|
-
exceptional_closure_info.get("date"), "%Y-%m-%d"
|
154
|
-
).date()
|
155
|
-
if not current_date == exceptional_closure_date:
|
156
|
-
continue
|
157
|
-
for k, v in day_schedule.items():
|
158
|
-
day_schedule[k] = ""
|
159
|
-
if k == "comment":
|
160
|
-
day_schedule[k] = exceptional_closure_info.get("title")
|
161
|
-
# sample : {'afternoonend': '16:00', 'afternoonstart': '14:00', 'comment': '', 'morningend': '14:00', 'morningstart': '09:00'}
|
162
|
-
return day_schedule
|
163
|
-
|
164
|
-
def get_week_days(self):
|
165
|
-
"""Returns a list of Messages for the weekday names."""
|
166
|
-
PLMF = MessageFactory("plonelocales")
|
167
|
-
ts = api.portal.get_tool("translation_service")
|
168
|
-
weekdays = []
|
169
|
-
now = date.today()
|
170
|
-
for i in range(0, 7):
|
171
|
-
ref_date = now + timedelta(days=i)
|
172
|
-
# weekday 0 == monday in python
|
173
|
-
# ts.day_msgid 0 = sunday in plone
|
174
|
-
ref_date_tsweekday = (ref_date.weekday() + 1) % 7
|
175
|
-
weekdays.append(
|
176
|
-
{
|
177
|
-
PLMF(
|
178
|
-
ts.day_msgid(ref_date_tsweekday, format="s"),
|
179
|
-
default=ts.weekday_english(ref_date_tsweekday, format="a"),
|
180
|
-
): self.get_schedule_for_date(ref_date)
|
181
|
-
}
|
182
|
-
)
|
183
|
-
return weekdays
|
184
|
-
|
185
|
-
def get_schedule_for_date(self, a_date):
|
186
|
-
return self.get_opening_informations(a_date)
|
187
|
-
|
188
|
-
def get_schedule_for_today(self, schedule):
|
189
|
-
return get_schedule_for_today(schedule)
|
190
|
-
|
191
|
-
def formatted_schedule(self, schedule):
|
192
|
-
return formatted_schedule(schedule)
|
193
|
-
|
194
|
-
def is_empty_schedule(self):
|
195
|
-
schedule = self.contact.get("schedule") or {}
|
196
|
-
for day in schedule.values():
|
197
|
-
for value in day.values():
|
198
|
-
if value:
|
199
|
-
return False
|
200
|
-
return True
|
201
|
-
|
202
114
|
def formatted_address(self):
|
203
115
|
street_parts = [
|
204
116
|
self.contact.get("street"),
|
@@ -219,67 +131,3 @@ class ContactProperties:
|
|
219
131
|
if not (street or entity or country):
|
220
132
|
return None
|
221
133
|
return {"street": street, "entity": entity, "country": country}
|
222
|
-
|
223
|
-
|
224
|
-
def formatted_schedule(schedule):
|
225
|
-
# opening = {'afternoonend': '', 'afternoonstart': '', 'comment': '', 'morningend': '12:00', 'morningstart': '08:30'}
|
226
|
-
current_lang = api.portal.get_current_language()[:2]
|
227
|
-
morningstart = schedule.get("morningstart")
|
228
|
-
morningend = schedule.get("morningend")
|
229
|
-
afternoonstart = schedule.get("afternoonstart")
|
230
|
-
afternoonend = schedule.get("afternoonend")
|
231
|
-
comment = schedule.get("comment")
|
232
|
-
str_opening = ""
|
233
|
-
morning = False
|
234
|
-
if morningend:
|
235
|
-
morning = True
|
236
|
-
str_opening = "{} - {}".format(morningstart, morningend)
|
237
|
-
if morning is True and afternoonstart:
|
238
|
-
str_opening += " | {} - {}".format(afternoonstart, afternoonend)
|
239
|
-
elif morning is False and afternoonstart:
|
240
|
-
str_opening = "{} - {}".format(afternoonstart, afternoonend)
|
241
|
-
elif not morningend and not afternoonstart:
|
242
|
-
str_opening = "{} - {}".format(morningstart, afternoonend)
|
243
|
-
if not morningstart and not morningend and not afternoonstart and not afternoonend:
|
244
|
-
str_opening = translate(_("Closed"), target_language=current_lang)
|
245
|
-
return "{} ({})".format(str_opening, comment) if comment else str_opening
|
246
|
-
|
247
|
-
|
248
|
-
# {'afternoonend': '', 'afternoonstart': '', 'comment': 'vendredi : apéro à midi', 'morningend': '11:00', 'morningstart': '08:30'}
|
249
|
-
def get_schedule_for_today(schedule):
|
250
|
-
current_lang = api.portal.get_current_language()[:2]
|
251
|
-
message = translate(_("Open"), target_language=current_lang)
|
252
|
-
comment = schedule.get("comment") or ""
|
253
|
-
morningstart = Decimal(schedule.get("morningstart").replace(":", ".") or "0.00")
|
254
|
-
morningend = Decimal(schedule.get("morningend").replace(":", ".") or "0.00")
|
255
|
-
afternoonstart = Decimal(schedule.get("afternoonstart").replace(":", ".") or "0.00")
|
256
|
-
afternoonend = Decimal(schedule.get("afternoonend").replace(":", ".") or "0.00")
|
257
|
-
|
258
|
-
now_str = Decimal(datetime.now().strftime("%H.%M"))
|
259
|
-
if not morningstart and not morningend and not afternoonstart and not afternoonend:
|
260
|
-
translated_closed = translate(_("Closed"), target_language=current_lang)
|
261
|
-
return (
|
262
|
-
"{} ({})".format(translated_closed, comment)
|
263
|
-
if comment
|
264
|
-
else translated_closed
|
265
|
-
)
|
266
|
-
before_opened = now_str < (morningstart or afternoonstart)
|
267
|
-
if before_opened:
|
268
|
-
translated_open_at = translate(_("Open at "), target_language=current_lang)
|
269
|
-
hour, minute = str(morningstart or afternoonstart).split(".")
|
270
|
-
message = "{} {:02d}:{:02d}".format(translated_open_at, int(hour), int(minute))
|
271
|
-
|
272
|
-
lunch_time = is_now_between(now_str, morningend, afternoonstart)
|
273
|
-
if lunch_time:
|
274
|
-
message = translate(_("Lunch time"), target_language=current_lang)
|
275
|
-
|
276
|
-
after_closed = now_str >= (afternoonend or morningend)
|
277
|
-
if after_closed:
|
278
|
-
message = translate(_("Closed"), target_language=current_lang)
|
279
|
-
return "{} ({})".format(message, comment) if comment else message
|
280
|
-
|
281
|
-
|
282
|
-
def is_now_between(now, start, end):
|
283
|
-
if not start or not end:
|
284
|
-
return False
|
285
|
-
return now >= start and now < end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
+
from imio.smartweb.common.widgets.select import TranslatedAjaxSelectWidget
|
3
4
|
from imio.smartweb.core.contents.sections.base import ISection
|
4
5
|
from imio.smartweb.core.contents.sections.base import Section
|
5
6
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
6
7
|
from plone.app.z3cform.widget import RelatedItemsFieldWidget
|
7
|
-
from plone.app.z3cform.widget import AjaxSelectFieldWidget
|
8
8
|
from plone.app.z3cform.widget import SelectFieldWidget
|
9
9
|
from plone.autoform import directives
|
10
10
|
from plone.supermodel import model
|
@@ -13,8 +13,8 @@ from zope import schema
|
|
13
13
|
from zope.globalrequest import getRequest
|
14
14
|
from zope.i18n import translate
|
15
15
|
from zope.interface import implementer
|
16
|
-
from zope.schema.interfaces import IContextAwareDefaultFactory
|
17
16
|
from zope.interface import provider
|
17
|
+
from zope.schema.interfaces import IContextAwareDefaultFactory
|
18
18
|
|
19
19
|
|
20
20
|
@provider(IContextAwareDefaultFactory)
|
@@ -40,8 +40,9 @@ class ISectionEvents(ISection):
|
|
40
40
|
)
|
41
41
|
directives.widget(
|
42
42
|
"specific_related_events",
|
43
|
-
|
44
|
-
|
43
|
+
TranslatedAjaxSelectWidget,
|
44
|
+
vocabulary="imio.smartweb.vocabulary.EventsFromEntity",
|
45
|
+
pattern_options={"multiple": True},
|
45
46
|
)
|
46
47
|
|
47
48
|
directives.widget(
|
@@ -85,6 +86,13 @@ class ISectionEvents(ISection):
|
|
85
86
|
title=_("Show items description"), required=False
|
86
87
|
)
|
87
88
|
|
89
|
+
model.fieldset("layout", fields=["display_agendas_titles"])
|
90
|
+
display_agendas_titles = schema.Bool(
|
91
|
+
title=_("Display agendas titles"),
|
92
|
+
description=_("If checked, display agendas titles in the carousel view."),
|
93
|
+
required=False,
|
94
|
+
)
|
95
|
+
|
88
96
|
|
89
97
|
@implementer(ISectionEvents)
|
90
98
|
class SectionEvents(Section):
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
from datetime import date
|
4
4
|
from dateutil.parser import parse
|
5
|
+
from imio.smartweb.common.utils import translate_vocabulary_term
|
5
6
|
from imio.smartweb.core.config import EVENTS_URL
|
6
7
|
from imio.smartweb.core.contents.sections.views import CarouselOrTableSectionView
|
7
8
|
from imio.smartweb.core.contents.sections.views import HashableJsonSectionView
|
@@ -27,7 +28,10 @@ class EventsView(CarouselOrTableSectionView, HashableJsonSectionView):
|
|
27
28
|
)
|
28
29
|
params = [
|
29
30
|
selected_item,
|
31
|
+
"metadata_fields=container_uid",
|
30
32
|
"metadata_fields=category_title",
|
33
|
+
"metadata_fields=local_category",
|
34
|
+
"metadata_fields=topics",
|
31
35
|
"metadata_fields=start",
|
32
36
|
"metadata_fields=end",
|
33
37
|
"metadata_fields=has_leadimage",
|
@@ -62,13 +66,23 @@ class EventsView(CarouselOrTableSectionView, HashableJsonSectionView):
|
|
62
66
|
end = item["end"] and parse(item["end"]) or None
|
63
67
|
date_dict = {"start": start, "end": end}
|
64
68
|
modified_hash = hash_md5(item["modified"])
|
69
|
+
category = ""
|
70
|
+
if self.context.show_categories_or_topics == "category":
|
71
|
+
category = item.get("local_category") or item.get("category_title", "")
|
72
|
+
elif self.context.show_categories_or_topics == "topic":
|
73
|
+
topic = item.get("topics") and item["topics"][0] or None
|
74
|
+
category = translate_vocabulary_term(
|
75
|
+
"imio.smartweb.vocabulary.Topics", topic
|
76
|
+
)
|
65
77
|
dict_item = {
|
66
78
|
"uid": item_uid,
|
67
79
|
"title": item["title"],
|
68
80
|
"description": item["description"],
|
69
|
-
"category":
|
81
|
+
"category": category,
|
70
82
|
"event_date": date_dict,
|
71
|
-
"url": f"{linking_view_url}
|
83
|
+
"url": f"{linking_view_url}/{item_id}?u={item_uid}",
|
84
|
+
"container_id": item.get("usefull_container_id", None),
|
85
|
+
"container_title": item.get("usefull_container_title", None),
|
72
86
|
"has_image": item["has_leadimage"],
|
73
87
|
"image": f"{item_url}/@@images/image/{orientation}_{image_scale}?cache_key={modified_hash}",
|
74
88
|
}
|
@@ -85,3 +99,7 @@ class EventsView(CarouselOrTableSectionView, HashableJsonSectionView):
|
|
85
99
|
|
86
100
|
def is_multi_dates(self, start, end):
|
87
101
|
return start and end and start.date() != end.date()
|
102
|
+
|
103
|
+
@property
|
104
|
+
def display_container_title(self):
|
105
|
+
return self.context.display_agendas_titles
|
@@ -19,4 +19,33 @@
|
|
19
19
|
permission="zope2.View"
|
20
20
|
layer="imio.smartweb.core.interfaces.IImioSmartwebCoreLayer"
|
21
21
|
/>
|
22
|
+
|
23
|
+
<browser:page
|
24
|
+
name="view_idelux_waste"
|
25
|
+
for="*"
|
26
|
+
class="imio.smartweb.core.contents.sections.external_content.views.IdeluxWasteView"
|
27
|
+
template="view_idelux_waste.pt"
|
28
|
+
permission="zope2.View"
|
29
|
+
layer="imio.smartweb.core.interfaces.IImioSmartwebCoreLayer"
|
30
|
+
/>
|
31
|
+
|
32
|
+
<browser:page
|
33
|
+
name="view_inbw_container_affluence"
|
34
|
+
for="*"
|
35
|
+
class="imio.smartweb.core.contents.sections.external_content.views.InbwContainersAffluenceView"
|
36
|
+
template="view_inbw_containers_affluence.pt"
|
37
|
+
permission="zope2.View"
|
38
|
+
layer="imio.smartweb.core.interfaces.IImioSmartwebCoreLayer"
|
39
|
+
/>
|
40
|
+
|
41
|
+
|
42
|
+
<browser:page
|
43
|
+
name="view_odwb_widget"
|
44
|
+
for="*"
|
45
|
+
class="imio.smartweb.core.contents.sections.external_content.views.OdwbWidgetView"
|
46
|
+
template="view_odwb_widget.pt"
|
47
|
+
permission="zope2.View"
|
48
|
+
layer="imio.smartweb.core.interfaces.IImioSmartwebCoreLayer"
|
49
|
+
/>
|
50
|
+
|
22
51
|
</configure>
|
@@ -12,21 +12,39 @@
|
|
12
12
|
<metal:macro use-macro="context/@@sections_macros/section_edition" />
|
13
13
|
<div class="container section-container section-external-content"
|
14
14
|
id=""
|
15
|
+
define="datas view/get_datas"
|
15
16
|
tal:attributes="id string:container-section-${context/id}">
|
16
17
|
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
<tal:check tal:condition="view/has_leadimage">
|
20
|
+
<img tal:attributes="src view/image" />
|
21
|
+
</tal:check>
|
21
22
|
|
22
23
|
<metal:macro use-macro="context/@@sections_macros/section_title" />
|
23
24
|
|
24
25
|
<p tal:replace="structure context/@@description" />
|
26
|
+
<div tal:define="which_plugin view/which_plugin">
|
27
|
+
|
28
|
+
<div tal:condition="not:which_plugin"
|
29
|
+
tal:define="collapse_klass python: 'collapse' if context.collapsible_section else ''"
|
30
|
+
tal:attributes="class string:body-section ${collapse_klass};
|
31
|
+
id string:body-section-${context/id}"
|
32
|
+
tal:content="structure view/contents" />
|
33
|
+
|
34
|
+
<div tal:condition="python:which_plugin == 'ideluxwasteplugin'">
|
35
|
+
<metal:block use-macro="context/@@view_idelux_waste/embeded_datas" tal:define="datas view/contents"></metal:block>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div tal:condition="python:which_plugin == 'inbwcontainersaffluenceplugin'">
|
39
|
+
<metal:block use-macro="context/@@view_inbw_container_affluence/embeded_datas" tal:define="datas view/contents"></metal:block>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div tal:condition="python:which_plugin == 'odwbwidgetplugin'">
|
43
|
+
<metal:block use-macro="context/@@view_odwb_widget/embeded_datas" tal:define="datas view/contents"></metal:block>
|
44
|
+
</div>
|
45
|
+
|
46
|
+
</div>
|
25
47
|
|
26
|
-
<div tal:define="collapse_klass python: 'collapse' if context.collapsible_section else ''"
|
27
|
-
tal:attributes="class string:body-section ratio ${collapse_klass};
|
28
|
-
id string:body-section-${context/id}"
|
29
|
-
tal:content="structure view/get_embed_external_content" />
|
30
48
|
|
31
49
|
</div>
|
32
50
|
</metal:content-core>
|
@@ -0,0 +1,50 @@
|
|
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
|
+
|
8
|
+
<metal:macro define-macro="embeded_datas">
|
9
|
+
<script>
|
10
|
+
$(document).ready(function() {
|
11
|
+
$('#searchInput').on('input', function() {
|
12
|
+
var searchTerm = $(this).val().toLowerCase();
|
13
|
+
|
14
|
+
// Loop through each item in the results
|
15
|
+
$('.result-item').each(function() {
|
16
|
+
var searchable = $(this).data('searchable').toLowerCase();
|
17
|
+
|
18
|
+
// If the keyword is found in the consignes_de_tri, show the item, otherwise hide it
|
19
|
+
if (searchable.includes(searchTerm)) {
|
20
|
+
$(this).show(); // Show the matching item
|
21
|
+
} else {
|
22
|
+
$(this).hide(); // Hide the non-matching item
|
23
|
+
}
|
24
|
+
});
|
25
|
+
});
|
26
|
+
});
|
27
|
+
</script>
|
28
|
+
<input type="text" id="searchInput" class="form-control" placeholder="Search Consignes de Tri">
|
29
|
+
<div id="results">
|
30
|
+
<!-- Results will be populated here -->
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div tal:define="results datas/results">
|
34
|
+
<ul tal:repeat="res results">
|
35
|
+
<tal:def define="filiere res/filiere;
|
36
|
+
dechet res/dechet;
|
37
|
+
infoparc res/infoparc;
|
38
|
+
consignes_de_tri res/consignes_de_tri;
|
39
|
+
searchable string:${filiere} ${dechet} ${infoparc} ${consignes_de_tri}">
|
40
|
+
<li class="result-item" data-searchable="${searchable}" >
|
41
|
+
<h3 tal:content="string:${filiere} - ${dechet}" />
|
42
|
+
<p tal:content="infoparc"></p>
|
43
|
+
<p tal:content="consignes_de_tri"></p>
|
44
|
+
</li>
|
45
|
+
|
46
|
+
</tal:def>
|
47
|
+
</ul>
|
48
|
+
</div>
|
49
|
+
</metal:macro>
|
50
|
+
</html>
|
@@ -0,0 +1,91 @@
|
|
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
|
+
|
8
|
+
<metal:macro define-macro="embeded_datas">
|
9
|
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
10
|
+
<script>
|
11
|
+
$(document).ready(function () {
|
12
|
+
var today = new Date().getDay();
|
13
|
+
var hours = new Date().getHours(); // Get current hour
|
14
|
+
var daysOfWeek = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
|
15
|
+
var currentDay = daysOfWeek[today];
|
16
|
+
var jsonDataString = $('#json-data').attr("data");
|
17
|
+
|
18
|
+
var jsonData = JSON.parse(jsonDataString);
|
19
|
+
var todayData = JSON.parse(jsonData.results[0][currentDay]);
|
20
|
+
var current_affluence = jsonData.results[0].current_affluence;
|
21
|
+
|
22
|
+
var keys = [];
|
23
|
+
var dataset1 = [];
|
24
|
+
var dataset2 = [];
|
25
|
+
|
26
|
+
Object.entries(todayData).forEach(function([key, value]) {
|
27
|
+
keys.push(key + "h00");
|
28
|
+
console.log('key' + key + 'hours' + hours);
|
29
|
+
if (key == hours) {
|
30
|
+
dataset2.push(current_affluence);
|
31
|
+
}
|
32
|
+
else {dataset2.push(0);}
|
33
|
+
dataset1.push(value);
|
34
|
+
});
|
35
|
+
|
36
|
+
|
37
|
+
// Define the Chart.js data and options
|
38
|
+
var chartData = {
|
39
|
+
labels: keys, // Hours
|
40
|
+
datasets: [{
|
41
|
+
label: currentDay + ' average affluence',
|
42
|
+
data: dataset1,
|
43
|
+
backgroundColor: 'rgba(54, 162, 235, 0.2)',
|
44
|
+
borderColor: 'rgba(54, 162, 235, 1)',
|
45
|
+
borderWidth: 1
|
46
|
+
},
|
47
|
+
{
|
48
|
+
label: 'Current affluence',
|
49
|
+
data: dataset2,
|
50
|
+
backgroundColor: 'rgba(255, 99, 132, 0.2)', // Specify the desired color
|
51
|
+
borderColor: 'rgba(255, 99, 132, 1)', // Specify the desired color
|
52
|
+
borderWidth: 1
|
53
|
+
}]
|
54
|
+
};
|
55
|
+
|
56
|
+
var chartOptions = {
|
57
|
+
scales: {
|
58
|
+
x: {
|
59
|
+
title: {
|
60
|
+
display: true,
|
61
|
+
text: 'Hours'
|
62
|
+
}
|
63
|
+
},
|
64
|
+
y: {
|
65
|
+
title: {
|
66
|
+
display: true,
|
67
|
+
text: 'Values'
|
68
|
+
},
|
69
|
+
ticks: {
|
70
|
+
stepSize: 1
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
};
|
75
|
+
|
76
|
+
// Get the canvas element
|
77
|
+
var ctx = document.getElementById('myChart').getContext('2d');
|
78
|
+
// Create the Chart.js chart
|
79
|
+
var myChart = new Chart(ctx, {
|
80
|
+
type: 'bar',
|
81
|
+
data: chartData,
|
82
|
+
options: chartOptions
|
83
|
+
});
|
84
|
+
});
|
85
|
+
|
86
|
+
</script>
|
87
|
+
<div id="json-data" tal:attributes="data datas"></div>
|
88
|
+
<canvas id="myChart" width="60%" height="" ></canvas>
|
89
|
+
|
90
|
+
</metal:macro>
|
91
|
+
</html>
|