imio.smartweb.core 1.2.38__py3-none-any.whl → 1.2.80__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- imio/smartweb/core/behaviors/categorization.py +24 -0
- imio/smartweb/core/behaviors/configure.zcml +7 -0
- imio/smartweb/core/browser/controlpanel.py +43 -0
- imio/smartweb/core/browser/faceted/block_view.pt +4 -4
- imio/smartweb/core/browser/faceted/summary_view.pt +4 -4
- imio/smartweb/core/browser/sitemap.py +10 -3
- imio/smartweb/core/browser/static/icons/action-delete.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-engagement-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/action-panneaux.svg +3 -0
- imio/smartweb/core/browser/static/icons/action-vote.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-attention.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-infos-travaux-2.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-mon-dossier.svg +1 -1
- imio/smartweb/core/browser/static/icons/categorie-nature.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-parcs-a-conteneurs.svg +4 -0
- imio/smartweb/core/browser/static/icons/categorie-plus.svg +3 -0
- imio/smartweb/core/browser/static/icons/categorie-primes-2.svg +5 -0
- imio/smartweb/core/browser/static/icons/categorie-sport-natation.svg +4 -0
- imio/smartweb/core/browser/static/icons/organisation-ecole-sac.svg +4 -0
- imio/smartweb/core/browser/static/icons/organisation-scout.svg +3 -0
- imio/smartweb/core/browser/static/icons/reseausocial-behance.svg +3 -0
- imio/smartweb/core/browser/static/icons/reseausocial-linkedin.svg +3 -0
- imio/smartweb/core/browser/static/smartweb-edit-compiled.css +1 -1
- imio/smartweb/core/browser/static/smartweb-view-compiled.css +1 -1
- imio/smartweb/core/browser/static/src/edit.less +42 -0
- imio/smartweb/core/browser/static/src/view.less +109 -56
- imio/smartweb/core/browser/vocabulary.py +8 -3
- imio/smartweb/core/contents/__init__.py +2 -0
- imio/smartweb/core/contents/configure.zcml +1 -0
- imio/smartweb/core/contents/folder/block_view.pt +8 -8
- imio/smartweb/core/contents/folder/summary_view.pt +4 -4
- imio/smartweb/core/contents/pages/cirkwi/content.py +5 -0
- imio/smartweb/core/contents/pages/cirkwi/view.py +2 -1
- imio/smartweb/core/contents/pages/configure.zcml +1 -0
- imio/smartweb/core/contents/pages/portal_page/view.py +3 -0
- imio/smartweb/core/contents/pages/views.py +47 -1
- imio/smartweb/core/contents/publication/__init__.py +0 -0
- imio/smartweb/core/contents/publication/configure.zcml +5 -0
- imio/smartweb/core/contents/publication/content.py +23 -0
- imio/smartweb/core/contents/rest/base.py +9 -7
- imio/smartweb/core/contents/rest/directory/endpoint.py +2 -2
- imio/smartweb/core/contents/rest/directory/view.pt +2 -1
- imio/smartweb/core/contents/rest/events/content.py +13 -0
- imio/smartweb/core/contents/rest/events/endpoint.py +5 -3
- imio/smartweb/core/contents/rest/events/view.pt +5 -1
- imio/smartweb/core/contents/rest/events/view.py +12 -0
- imio/smartweb/core/contents/rest/news/content.py +6 -0
- imio/smartweb/core/contents/rest/news/endpoint.py +4 -2
- imio/smartweb/core/contents/rest/news/view.pt +4 -1
- imio/smartweb/core/contents/rest/news/view.py +8 -0
- imio/smartweb/core/contents/rest/utils.py +0 -1
- imio/smartweb/core/contents/rest/view.py +4 -0
- imio/smartweb/core/contents/sections/common_templates/carousel.pt +5 -1
- imio/smartweb/core/contents/sections/common_templates/table.pt +18 -4
- imio/smartweb/core/contents/sections/configure.zcml +18 -0
- imio/smartweb/core/contents/sections/contact/content.py +2 -2
- imio/smartweb/core/contents/sections/contact/macros.pt +28 -3
- imio/smartweb/core/contents/sections/contact/utils.py +2 -0
- imio/smartweb/core/contents/sections/contact/view.py +28 -12
- imio/smartweb/core/contents/sections/events/content.py +12 -4
- imio/smartweb/core/contents/sections/events/view.py +20 -2
- imio/smartweb/core/contents/sections/external_content/view.pt +4 -4
- imio/smartweb/core/contents/sections/external_content/views.py +6 -4
- imio/smartweb/core/contents/sections/files/content.py +7 -1
- imio/smartweb/core/contents/sections/files/view.py +43 -12
- imio/smartweb/core/contents/sections/links/view.py +5 -0
- imio/smartweb/core/contents/sections/macros.pt +26 -0
- imio/smartweb/core/contents/sections/news/content.py +11 -3
- imio/smartweb/core/contents/sections/news/view.py +20 -2
- imio/smartweb/core/contents/sections/text/views.py +2 -0
- imio/smartweb/core/contents/sections/views.py +73 -10
- imio/smartweb/core/interfaces.py +4 -0
- imio/smartweb/core/profiles/default/metadata.xml +1 -1
- imio/smartweb/core/profiles/default/taxonomies/page_category.xml +16 -0
- imio/smartweb/core/profiles/default/taxonomies/procedure_category.xml +26 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.EventsView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.NewsView.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.Publication.xml +38 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionEvents.xml +1 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionFiles.xml +2 -0
- imio/smartweb/core/profiles/default/types/imio.smartweb.SectionNews.xml +1 -0
- imio/smartweb/core/profiles/default/types.xml +1 -0
- imio/smartweb/core/profiles/icons/basic/registry.xml +120 -0
- imio/smartweb/core/rest/authentic_sources.py +17 -2
- imio/smartweb/core/subscribers.py +48 -0
- imio/smartweb/core/subscribers.zcml +12 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_institutions.json +60 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_publication.json +105 -0
- imio/smartweb/core/tests/resources/json_iadeliberations_publications.json +270 -0
- imio/smartweb/core/tests/resources/json_rest_events.json +6 -2
- imio/smartweb/core/tests/resources/json_rest_news.json +2 -2
- imio/smartweb/core/tests/resources/json_rest_specific_events.json +1 -1
- imio/smartweb/core/tests/test_htmx_in_sections.py +131 -0
- imio/smartweb/core/tests/test_iadeliberations.py +136 -0
- imio/smartweb/core/tests/test_icons.py +1 -1
- imio/smartweb/core/tests/test_rest.py +58 -17
- imio/smartweb/core/tests/test_section_contact.py +42 -10
- imio/smartweb/core/tests/test_section_events.py +28 -5
- imio/smartweb/core/tests/test_section_external_content.py +28 -2
- imio/smartweb/core/tests/test_section_news.py +30 -8
- imio/smartweb/core/tests/test_sections.py +17 -0
- imio/smartweb/core/tests/test_vocabularies.py +60 -3
- imio/smartweb/core/tests/test_vocabulary.py +43 -0
- imio/smartweb/core/upgrades/configure.zcml +108 -0
- imio/smartweb/core/upgrades/profiles/1055_to_1056/types/imio.smartweb.SectionFiles.xml +12 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.EventsView.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.NewsView.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionEvents.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionNews.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.cfg +9 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.xml +73 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.cfg +9 -0
- imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.xml +118 -0
- imio/smartweb/core/upgrades/profiles/1058_to_1059/registry/linkedin-icon.xml +126 -0
- imio/smartweb/core/upgrades/profiles/1059_to_1060/registry/iadeliberation.xml +9 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.Publication.xml +38 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.SectionFiles.xml +11 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/types.xml +4 -0
- imio/smartweb/core/upgrades/profiles/1060_to_1061/workflows.xml +6 -0
- imio/smartweb/core/utils.py +33 -2
- imio/smartweb/core/viewlets/configure.zcml +23 -1
- imio/smartweb/core/viewlets/footer.pt +5 -0
- imio/smartweb/core/viewlets/footer.py +5 -0
- imio/smartweb/core/viewlets/htmx.py +15 -0
- imio/smartweb/core/viewlets/htmx_js_header.pt +64 -0
- imio/smartweb/core/viewlets/ogptags.py +4 -3
- imio/smartweb/core/viewlets/social.py +23 -0
- imio/smartweb/core/vocabularies.py +65 -3
- imio/smartweb/core/vocabularies.zcml +18 -0
- imio/smartweb/core/webcomponents/build/1c1605a5fe9a2b10a88f.png +1 -0
- imio/smartweb/core/webcomponents/build/524db40e119aa11f4478.png +1 -0
- imio/smartweb/core/webcomponents/build/57d3b7cb1ab874660b39.svg +1 -0
- imio/smartweb/core/webcomponents/build/6cf03871df23ed2ee8b3.png +1 -0
- imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/884.smartweb-webcomponents-compiled.css +1 -0
- imio/smartweb/core/webcomponents/build/css/919.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +10 -8
- imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +2 -1
- imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js.LICENSE.txt → 373.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -4
- imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/499.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/{674.smartweb-webcomponents-compiled.js.LICENSE.txt → 499.smartweb-webcomponents-compiled.js.LICENSE.txt} +1 -8
- imio/smartweb/core/webcomponents/build/js/799.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/824.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js.LICENSE.txt +32 -0
- imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -0
- imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js → 963.smartweb-webcomponents-compiled.js} +2 -2
- imio/smartweb/core/webcomponents/build/js/963.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -0
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js.LICENSE.txt +11 -14
- imio/smartweb/core/webcomponents/package.json +42 -40
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +146 -79
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +415 -351
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +95 -62
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +328 -168
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +21 -4
- imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +213 -100
- imio/smartweb/core/webcomponents/src/components/Annuaire/index.js +1 -1
- imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +76 -33
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +604 -377
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +29 -4
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +162 -88
- imio/smartweb/core/webcomponents/src/components/Events/Events.scss +496 -378
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +259 -91
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -55
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +68 -17
- imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
- imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +229 -0
- imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
- imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
- imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +139 -83
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +133 -67
- imio/smartweb/core/webcomponents/src/components/News/News.scss +170 -127
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +76 -44
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +261 -188
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +48 -9
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +21 -10
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +21 -10
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +8 -9
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +7 -6
- imio/smartweb/core/webcomponents/src/components/Search/Search.scss +115 -96
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +12 -3
- imio/smartweb/core/webcomponents/src/components/Search/index.js +1 -1
- imio/smartweb/core/webcomponents/src/hooks/ScrollContext.jsx +3 -0
- imio/smartweb/core/webcomponents/src/hooks/useAxios.js +3 -3
- imio/smartweb/core/webcomponents/src/hooks/useFilterQuery.js +1 -2
- imio/smartweb/core/webcomponents/src/index.scss +255 -211
- imio/smartweb/core/webcomponents/src/utils/Map.jsx +26 -19
- imio/smartweb/core/webcomponents/src/utils/Map.scss +2 -2
- imio/smartweb/core/webcomponents/src/utils/translation.js +129 -9
- imio.smartweb.core-1.2.80-py3.8-nspkg.pth +2 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.80.dist-info}/METADATA +410 -10
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.80.dist-info}/RECORD +207 -161
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.80.dist-info}/WHEEL +1 -1
- imio/smartweb/core/webcomponents/build/assets/location-bla.1423bcce16ddcb21141430cac1428dc1.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/next-react-white.819cb069ac8eec300a9db6a7707712d6.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/next-react.17bc43ff4a6a86f4520f5782f6a89a72.svg +0 -1
- imio/smartweb/core/webcomponents/build/assets/search.57bdbf5b191499cd77514097d1c4972c.svg +0 -1
- imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/js/209.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/40.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/build/js/674.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/src/assets/facebook-news.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/location-bla.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/next-react.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/search.svg +0 -1
- imio/smartweb/core/webcomponents/src/assets/skeleton.svg +0 -1
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/download.svg +0 -1
- imio.smartweb.core-1.2.38-py3.8-nspkg.pth +0 -3
- /imio/smartweb/core/webcomponents/build/js/{209.smartweb-webcomponents-compiled.js.LICENSE.txt → 824.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.80.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.80.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.80.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.80.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,20 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
|
2
|
+
|
3
|
+
from imio.smartweb.common.browser.vocabulary import TranslatedVocabularyView
|
3
4
|
from plone.app.content.browser.vocabulary import VocabLookupException
|
4
5
|
from plone.app.content.utils import json_dumps
|
5
6
|
|
6
7
|
|
7
|
-
class SmartwebVocabularyView(
|
8
|
+
class SmartwebVocabularyView(TranslatedVocabularyView):
|
8
9
|
|
9
10
|
def __call__(self):
|
10
11
|
form = self.request.form
|
11
12
|
name = form.get("name")
|
12
|
-
if name
|
13
|
+
if name not in [
|
14
|
+
"imio.smartweb.vocabulary.RemoteContacts",
|
15
|
+
"imio.smartweb.vocabulary.NewsItemsFromEntity",
|
16
|
+
"imio.smartweb.vocabulary.EventsFromEntity",
|
17
|
+
]:
|
13
18
|
return super(SmartwebVocabularyView, self).__call__()
|
14
19
|
|
15
20
|
self.request.response.setHeader(
|
@@ -17,6 +17,8 @@ from .pages.portal_page.content import IPortalPage # NOQA
|
|
17
17
|
from .pages.portal_page.content import PortalPage # NOQA
|
18
18
|
from .pages.procedure.content import IProcedure # NOQA
|
19
19
|
from .pages.procedure.content import Procedure # NOQA
|
20
|
+
from .publication.content import Publication # NOQA
|
21
|
+
from .publication.content import IPublication # NOQA
|
20
22
|
from .rest.base import RestView # NOQA
|
21
23
|
from .rest.base import IRestView # NOQA
|
22
24
|
from .rest.directory.content import DirectoryView # NOQA
|
@@ -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 ""
|
@@ -1,8 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
3
|
from Acquisition import aq_inner
|
4
|
+
from imio.smartweb.core.config import DIRECTORY_URL
|
4
5
|
from imio.smartweb.core.utils import get_scale_url
|
6
|
+
from imio.smartweb.core.interfaces import IHtmxViewUtils
|
5
7
|
from imio.smartweb.core.interfaces import IViewWithoutLeadImage
|
8
|
+
from imio.smartweb.core.utils import get_json
|
6
9
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
7
10
|
from Products.CMFPlone.resources import add_bundle_on_request
|
8
11
|
from plone import api
|
@@ -10,17 +13,21 @@ from plone.app.content.browser.contents.rearrange import OrderContentsBaseAction
|
|
10
13
|
from plone.app.content.utils import json_loads
|
11
14
|
from plone.app.contenttypes.browser.folder import FolderView
|
12
15
|
from plone.app.contenttypes.browser.full_view import FullViewItem as BaseFullViewItem
|
16
|
+
from plone.memoize.view import memoize
|
13
17
|
from Products.CMFPlone import utils
|
14
18
|
from Products.CMFPlone.browser.navigation import PhysicalNavigationBreadcrumbs
|
15
19
|
from zope.component import getMultiAdapter
|
16
20
|
from zope.interface import implementer
|
17
21
|
|
22
|
+
import itertools
|
23
|
+
|
18
24
|
|
19
25
|
@implementer(IViewWithoutLeadImage)
|
26
|
+
@implementer(IHtmxViewUtils)
|
20
27
|
class PagesView(FolderView):
|
21
28
|
"""Pages view"""
|
22
29
|
|
23
|
-
b_size =
|
30
|
+
b_size = 70
|
24
31
|
|
25
32
|
def __call__(self):
|
26
33
|
# get gallery sections and sections with gallery
|
@@ -44,6 +51,45 @@ class PagesView(FolderView):
|
|
44
51
|
add_bundle_on_request(self.request, "flexbin")
|
45
52
|
return self.index()
|
46
53
|
|
54
|
+
@memoize
|
55
|
+
def get_page_contacts(self):
|
56
|
+
# TODO We need to check every tests to be sure to avoid caching that
|
57
|
+
# creates false positive assertions
|
58
|
+
sections_contacts = self.context.listFolderContents(
|
59
|
+
contentFilter={
|
60
|
+
"portal_type": [
|
61
|
+
"imio.smartweb.SectionContact",
|
62
|
+
]
|
63
|
+
}
|
64
|
+
)
|
65
|
+
if len(sections_contacts) == 0:
|
66
|
+
return None
|
67
|
+
nested_contact_list = [
|
68
|
+
section_contacts.related_contacts
|
69
|
+
for section_contacts in sections_contacts
|
70
|
+
if section_contacts.related_contacts is not None
|
71
|
+
]
|
72
|
+
if nested_contact_list == []:
|
73
|
+
return None
|
74
|
+
# Make a "set" to simplifying request in url (avoid duplicate uid)
|
75
|
+
# Sometimes we have duplicate uid because some pages were build with contact attributes
|
76
|
+
# in a section and for layout issues,for the same contact, others attributes are in another section.
|
77
|
+
page_contacts = list(
|
78
|
+
set(list(itertools.chain.from_iterable(nested_contact_list)))
|
79
|
+
)
|
80
|
+
uids = "&UID=".join(page_contacts)
|
81
|
+
bsize = len(page_contacts)
|
82
|
+
url = "{}/@search?UID={}&fullobjects=1&b_size={}".format(
|
83
|
+
DIRECTORY_URL, uids, bsize
|
84
|
+
)
|
85
|
+
current_lang = api.portal.get_current_language()[:2]
|
86
|
+
if current_lang != "fr":
|
87
|
+
url = f"{url}&translated_in_{current_lang}=1"
|
88
|
+
json_data = get_json(url)
|
89
|
+
if json_data is None or len(json_data.get("items", [])) == 0:
|
90
|
+
return
|
91
|
+
return json_data
|
92
|
+
|
47
93
|
def results(self, **kwargs):
|
48
94
|
"""
|
49
95
|
Gets results for folder listings without taking care of friendly_types
|
File without changes
|
@@ -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"""
|
@@ -4,6 +4,7 @@ from imio.smartweb.core.utils import get_json
|
|
4
4
|
from plone import api
|
5
5
|
from plone.dexterity.content import Container
|
6
6
|
from plone.rest import Service
|
7
|
+
from urllib.parse import urlencode
|
7
8
|
from zope.interface import implementer
|
8
9
|
from zope.interface import Interface
|
9
10
|
|
@@ -19,7 +20,7 @@ class BaseEndpoint(object):
|
|
19
20
|
self.request = request
|
20
21
|
|
21
22
|
def __call__(self):
|
22
|
-
results = get_json(self.query_url)
|
23
|
+
results = get_json(self.query_url, timeout=20)
|
23
24
|
return results
|
24
25
|
|
25
26
|
@property
|
@@ -47,21 +48,22 @@ class BaseEndpoint(object):
|
|
47
48
|
)
|
48
49
|
del item[field]
|
49
50
|
|
50
|
-
def
|
51
|
+
def construct_query_string(self, params):
|
52
|
+
params = "&".join(params)
|
51
53
|
form = self.request.form
|
52
54
|
extra_params = []
|
53
55
|
for k, v in form.items():
|
54
56
|
if isinstance(v, list):
|
55
57
|
# handles multiple metadata_fields
|
56
58
|
for value in v:
|
57
|
-
extra_params.append(
|
59
|
+
extra_params.append((k, value))
|
58
60
|
else:
|
59
|
-
extra_params.append(
|
61
|
+
extra_params.append((k, v))
|
60
62
|
current_lang = api.portal.get_current_language()[:2]
|
61
63
|
if current_lang != "fr":
|
62
|
-
extra_params.append("translated_in_{}
|
63
|
-
|
64
|
-
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]))
|
65
67
|
|
66
68
|
|
67
69
|
class BaseService(Service):
|
@@ -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
|
|
@@ -11,7 +11,8 @@
|
|
11
11
|
orientation view/orientation;
|
12
12
|
current-language view/current_language;
|
13
13
|
display-map view/display_map;
|
14
|
-
view-path view/view_path;
|
14
|
+
view-path view/view_path;
|
15
|
+
context-authenticated-user view/context_authenticated_user;"></smartweb-annuaire>
|
15
16
|
</div>
|
16
17
|
</metal:main>
|
17
18
|
</body>
|
@@ -37,6 +37,19 @@ 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
55
|
class EventsView(RestView):
|
@@ -13,7 +13,7 @@ from zope.interface import Interface
|
|
13
13
|
class BaseEventsEndpoint(BaseEndpoint):
|
14
14
|
def __call__(self):
|
15
15
|
results = super(BaseEventsEndpoint, self).__call__()
|
16
|
-
if not results.get("items"):
|
16
|
+
if not results or not results.get("items"):
|
17
17
|
return results
|
18
18
|
orientation = self.context.orientation
|
19
19
|
for result in results["items"]:
|
@@ -35,6 +35,8 @@ class BaseEventsEndpoint(BaseEndpoint):
|
|
35
35
|
params = [
|
36
36
|
"selected_agendas={}".format(self.context.selected_agenda),
|
37
37
|
"metadata_fields=category",
|
38
|
+
"metadata_fields=local_category",
|
39
|
+
"metadata_fields=container_uid",
|
38
40
|
"metadata_fields=topics",
|
39
41
|
"metadata_fields=start",
|
40
42
|
"metadata_fields=end",
|
@@ -47,8 +49,8 @@ class BaseEventsEndpoint(BaseEndpoint):
|
|
47
49
|
if self.context.selected_event_types is not None:
|
48
50
|
for event_type in self.context.selected_event_types:
|
49
51
|
params.append(f"event_type={event_type}")
|
50
|
-
params = self.
|
51
|
-
url = f"{EVENTS_URL}/{self.remote_endpoint}?{
|
52
|
+
params = self.construct_query_string(params)
|
53
|
+
url = f"{EVENTS_URL}/{self.remote_endpoint}?{params}"
|
52
54
|
return url
|
53
55
|
|
54
56
|
|
@@ -12,7 +12,11 @@
|
|
12
12
|
orientation view/orientation;
|
13
13
|
current-language view/current_language;
|
14
14
|
display-map view/display_map;
|
15
|
-
|
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>
|
16
20
|
</div>
|
17
21
|
</metal:main>
|
18
22
|
</body>
|
@@ -17,3 +17,15 @@ class EventsViewView(BaseRestView):
|
|
17
17
|
@property
|
18
18
|
def display_map(self):
|
19
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
|
@@ -21,6 +21,12 @@ 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
32
|
class NewsView(RestView):
|
@@ -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
|
|
@@ -11,7 +11,10 @@
|
|
11
11
|
propose-url view/propose_url;
|
12
12
|
orientation view/orientation;
|
13
13
|
current-language view/current_language;
|
14
|
-
view-path view/view_path;
|
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>
|
15
18
|
</div>
|
16
19
|
</metal:main>
|
17
20
|
</body>
|
@@ -13,3 +13,11 @@ class NewsViewView(BaseRestView):
|
|
13
13
|
@property
|
14
14
|
def propose_url(self):
|
15
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
|
@@ -5,7 +5,6 @@ from imio.smartweb.core.config import EVENTS_URL
|
|
5
5
|
from imio.smartweb.core.config import NEWS_URL
|
6
6
|
from imio.smartweb.core.utils import get_wca_token
|
7
7
|
from plone.memoize import ram
|
8
|
-
from plone.memoize.view import memoize
|
9
8
|
from time import time
|
10
9
|
from zope.component import getUtility
|
11
10
|
from zope.schema.interfaces import IVocabularyFactory
|
@@ -31,6 +31,10 @@ class BaseRestView(BrowserView):
|
|
31
31
|
def current_language(self):
|
32
32
|
return api.portal.get_current_language()[:2]
|
33
33
|
|
34
|
+
@property
|
35
|
+
def context_authenticated_user(self):
|
36
|
+
return api.user.is_anonymous()
|
37
|
+
|
34
38
|
@property
|
35
39
|
def view_path(self):
|
36
40
|
url = self.context.absolute_url()
|
@@ -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,6 +65,9 @@
|
|
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">
|
@@ -56,9 +56,10 @@
|
|
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
65
|
<div class="image d-block is-icon w-100"
|
@@ -84,7 +85,7 @@
|
|
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"
|
@@ -96,8 +97,14 @@
|
|
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 AjaxSelectFieldWidget
|
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
|
)
|