imio.smartweb.core 1.2.44__py3-none-any.whl → 1.2.45__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.
Files changed (75) hide show
  1. imio/smartweb/core/behaviors/categorization.py +24 -0
  2. imio/smartweb/core/behaviors/configure.zcml +7 -0
  3. imio/smartweb/core/browser/static/smartweb-edit-compiled.css +1 -1
  4. imio/smartweb/core/browser/static/src/edit.less +42 -0
  5. imio/smartweb/core/contents/pages/cirkwi/content.py +5 -0
  6. imio/smartweb/core/contents/pages/cirkwi/view.py +2 -1
  7. imio/smartweb/core/contents/rest/events/endpoint.py +1 -0
  8. imio/smartweb/core/contents/rest/events/view.pt +2 -1
  9. imio/smartweb/core/contents/rest/events/view.py +4 -0
  10. imio/smartweb/core/contents/rest/news/endpoint.py +1 -0
  11. imio/smartweb/core/contents/rest/news/view.pt +2 -1
  12. imio/smartweb/core/contents/rest/news/view.py +4 -0
  13. imio/smartweb/core/contents/sections/configure.zcml +1 -1
  14. imio/smartweb/core/contents/sections/events/view.py +11 -1
  15. imio/smartweb/core/contents/sections/macros.pt +3 -2
  16. imio/smartweb/core/contents/sections/news/view.py +11 -1
  17. imio/smartweb/core/contents/sections/views.py +4 -4
  18. imio/smartweb/core/profiles/default/metadata.xml +1 -1
  19. imio/smartweb/core/profiles/default/types/imio.smartweb.EventsView.xml +1 -0
  20. imio/smartweb/core/profiles/default/types/imio.smartweb.NewsView.xml +1 -0
  21. imio/smartweb/core/profiles/default/types/imio.smartweb.SectionEvents.xml +1 -0
  22. imio/smartweb/core/profiles/default/types/imio.smartweb.SectionNews.xml +1 -0
  23. imio/smartweb/core/tests/resources/json_rest_events.json +2 -1
  24. imio/smartweb/core/tests/resources/json_rest_news.json +2 -2
  25. imio/smartweb/core/tests/resources/json_rest_specific_events.json +1 -1
  26. imio/smartweb/core/tests/test_htmx_in_sections.py +8 -1
  27. imio/smartweb/core/tests/test_rest.py +36 -0
  28. imio/smartweb/core/tests/test_section_events.py +27 -5
  29. imio/smartweb/core/tests/test_section_news.py +16 -3
  30. imio/smartweb/core/tests/test_vocabularies.py +3 -0
  31. imio/smartweb/core/upgrades/configure.zcml +18 -0
  32. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.EventsView.xml +11 -0
  33. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.NewsView.xml +11 -0
  34. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionEvents.xml +11 -0
  35. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionNews.xml +11 -0
  36. imio/smartweb/core/utils.py +0 -23
  37. imio/smartweb/core/vocabularies.py +17 -0
  38. imio/smartweb/core/vocabularies.zcml +6 -0
  39. imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
  40. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
  41. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +1 -1
  42. imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +2 -1
  43. imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js.LICENSE.txt → 373.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -4
  44. imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
  45. imio/smartweb/core/webcomponents/build/js/499.smartweb-webcomponents-compiled.js +2 -0
  46. imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +1 -1
  47. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js +1 -1
  48. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -3
  49. imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
  50. imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js → 963.smartweb-webcomponents-compiled.js} +2 -2
  51. imio/smartweb/core/webcomponents/build/js/963.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -0
  52. imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
  53. imio/smartweb/core/webcomponents/package.json +1 -0
  54. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +265 -161
  55. imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +34 -21
  56. imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +2 -2
  57. imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +2 -1
  58. imio/smartweb/core/webcomponents/src/components/News/News.jsx +2 -1
  59. imio/smartweb/core/webcomponents/src/components/News/News.scss +8 -1
  60. imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +22 -5
  61. imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +2 -2
  62. imio/smartweb/core/webcomponents/src/utils/Map.jsx +1 -3
  63. imio/smartweb/core/webcomponents/src/utils/translation.js +49 -1
  64. {imio.smartweb.core-1.2.44.dist-info → imio.smartweb.core-1.2.45.dist-info}/METADATA +20 -1
  65. {imio.smartweb.core-1.2.44.dist-info → imio.smartweb.core-1.2.45.dist-info}/RECORD +72 -68
  66. imio/smartweb/core/webcomponents/build/assets/next-react-white.819cb069ac8eec300a9db6a7707712d6.svg +0 -1
  67. imio/smartweb/core/webcomponents/build/f79b479fdc5c0fe0d553.svg +0 -1
  68. imio/smartweb/core/webcomponents/build/js/496.smartweb-webcomponents-compiled.js +0 -2
  69. /imio/smartweb/core/webcomponents/build/js/{496.smartweb-webcomponents-compiled.js.LICENSE.txt → 499.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
  70. /imio.smartweb.core-1.2.44-py3.10-nspkg.pth → /imio.smartweb.core-1.2.45-py3.10-nspkg.pth +0 -0
  71. {imio.smartweb.core-1.2.44.dist-info → imio.smartweb.core-1.2.45.dist-info}/LICENSE.GPL +0 -0
  72. {imio.smartweb.core-1.2.44.dist-info → imio.smartweb.core-1.2.45.dist-info}/LICENSE.rst +0 -0
  73. {imio.smartweb.core-1.2.44.dist-info → imio.smartweb.core-1.2.45.dist-info}/WHEEL +0 -0
  74. {imio.smartweb.core-1.2.44.dist-info → imio.smartweb.core-1.2.45.dist-info}/namespace_packages.txt +0 -0
  75. {imio.smartweb.core-1.2.44.dist-info → imio.smartweb.core-1.2.45.dist-info}/top_level.txt +0 -0
@@ -227,6 +227,14 @@
227
227
  provides="Products.GenericSetup.interfaces.EXTENSION"
228
228
  />
229
229
 
230
+ <genericsetup:registerProfile
231
+ name="upgrade_1056_to_1057"
232
+ title="Upgrade core from 1056 to 1057"
233
+ directory="profiles/1056_to_1057"
234
+ description="Add imio.smartweb.category_display behavior on content types"
235
+ provides="Products.GenericSetup.interfaces.EXTENSION"
236
+ />
237
+
230
238
  <genericsetup:upgradeStep
231
239
  title="Configure first official release"
232
240
  description="Run needed profiles steps and reindex catalog"
@@ -801,4 +809,14 @@
801
809
  />
802
810
  </genericsetup:upgradeSteps>
803
811
 
812
+ <genericsetup:upgradeSteps
813
+ source="1056"
814
+ destination="1057"
815
+ profile="imio.smartweb.core:default">
816
+ <genericsetup:upgradeDepends
817
+ title="Add imio.smartweb.category_display behavior on content types"
818
+ import_profile="imio.smartweb.core.upgrades:upgrade_1056_to_1057"
819
+ />
820
+ </genericsetup:upgradeSteps>
821
+
804
822
  </configure>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0"?>
2
+ <object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ name="imio.smartweb.EventsView"
4
+ meta_type="Dexterity FTI"
5
+ i18n:domain="imio.smartweb">
6
+
7
+ <property name="behaviors" purge="false">
8
+ <element value="imio.smartweb.category_display"/>
9
+ </property>
10
+
11
+ </object>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0"?>
2
+ <object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ name="imio.smartweb.NewsView"
4
+ meta_type="Dexterity FTI"
5
+ i18n:domain="imio.smartweb">
6
+
7
+ <property name="behaviors" purge="false">
8
+ <element value="imio.smartweb.category_display"/>
9
+ </property>
10
+
11
+ </object>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0"?>
2
+ <object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ name="imio.smartweb.SectionEvents"
4
+ meta_type="Dexterity FTI"
5
+ i18n:domain="imio.smartweb">
6
+
7
+ <property name="behaviors" purge="false">
8
+ <element value="imio.smartweb.category_display"/>
9
+ </property>
10
+
11
+ </object>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0"?>
2
+ <object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ name="imio.smartweb.SectionNews"
4
+ meta_type="Dexterity FTI"
5
+ i18n:domain="imio.smartweb">
6
+
7
+ <property name="behaviors" purge="false">
8
+ <element value="imio.smartweb.category_display"/>
9
+ </property>
10
+
11
+ </object>
@@ -1,6 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- from Acquisition import aq_inner
4
3
  from Acquisition import aq_parent
5
4
  from collective.taxonomy.interfaces import ITaxonomy
6
5
  from imio.smartweb.core.config import WCA_URL
@@ -14,7 +13,6 @@ from Products.CMFPlone.interfaces.siteroot import IPloneSiteRoot
14
13
  from Products.CMFPlone.utils import base_hasattr
15
14
  from zope.component import getSiteManager
16
15
  from zope.component import queryMultiAdapter
17
- from zope.globalrequest import getRequest
18
16
 
19
17
  import hashlib
20
18
  import json
@@ -198,24 +196,3 @@ def get_plausible_vars():
198
196
  return plausible_vars
199
197
  else:
200
198
  return None
201
-
202
-
203
- def get_current_language(context=None):
204
- """Return the current negotiated language.
205
-
206
- :param context: context object
207
- :type context: object
208
- :returns: language identifier
209
- :rtype: string
210
- :Example: :ref:`portal-get-current-language-example`
211
- """
212
- request = getRequest()
213
- if request is None:
214
- return (
215
- context and aq_inner(context).Language()
216
- ) or api.portal.get_default_language()
217
- return (
218
- request.get("LANGUAGE", None)
219
- or (context and aq_inner(context).Language())
220
- or api.portal.get_default_language()
221
- )
@@ -118,6 +118,23 @@ class CurrentFolderPagesVocabularyFactory:
118
118
  CurrentFolderPagesVocabulary = CurrentFolderPagesVocabularyFactory()
119
119
 
120
120
 
121
+ class CategoriesDisplayVocabularyFactory:
122
+ def __call__(self, context=None):
123
+ values = [
124
+ ("category", _("Category")),
125
+ ("topic", _("Topic")),
126
+ ("", _("None")),
127
+ ]
128
+ terms = [
129
+ SimpleVocabulary.createTerm(value[0], value[0], value[1])
130
+ for value in values
131
+ ]
132
+ return SimpleVocabulary(terms)
133
+
134
+
135
+ CategoriesDisplayVocabulary = CategoriesDisplayVocabularyFactory()
136
+
137
+
121
138
  class BootstrapCSSVocabularyFactory:
122
139
  def __call__(self, context=None):
123
140
  bootstrap_css = [
@@ -19,6 +19,12 @@
19
19
  provides="zope.schema.interfaces.IVocabularyFactory"
20
20
  />
21
21
 
22
+ <utility
23
+ name="imio.smartweb.vocabulary.CategoriesDisplay"
24
+ component=".vocabularies.CategoriesDisplayVocabulary"
25
+ provides="zope.schema.interfaces.IVocabularyFactory"
26
+ />
27
+
22
28
  <utility
23
29
  name="imio.smartweb.vocabulary.BootstrapCSS"
24
30
  component=".vocabularies.BootstrapCSSVocabulary"
@@ -1 +1 @@
1
- .flexbin{display:flex;flex-wrap:wrap;margin:-2.5px;overflow:hidden}.flexbin:after{content:"";flex-grow:999999999;height:0;min-width:300px}.flexbin>*{display:block;flex-grow:1;height:300px;margin:2.5px;position:relative}.flexbin>*>img{height:300px;max-width:100%;min-width:100%;object-fit:cover;vertical-align:bottom}.flexbin.flexbin-margin{margin:2.5px}@media (max-width:980px){.flexbin{display:flex;flex-wrap:wrap;margin:-2.5px;overflow:hidden}.flexbin:after{content:"";flex-grow:999999999;height:0;min-width:150px}.flexbin>*{display:block;flex-grow:1;height:150px;margin:2.5px;position:relative}.flexbin>*>img{height:150px;max-width:100%;min-width:100%;object-fit:cover;vertical-align:bottom}.flexbin.flexbin-margin{margin:2.5px}}@media (max-width:400px){.flexbin{display:flex;flex-wrap:wrap;margin:-2.5px;overflow:hidden}.flexbin:after{content:"";flex-grow:999999999;height:0;min-width:100px}.flexbin>*{display:block;flex-grow:1;height:100px;margin:2.5px;position:relative}.flexbin>*>img{height:100px;max-width:100%;min-width:100%;object-fit:cover;vertical-align:bottom}.flexbin.flexbin-margin{margin:2.5px}}.breadcrumb{padding:0}.r-result-list{list-style:none;margin-top:50px;padding-left:0}#portal-column-content h1{font-size:0;position:absolute}#viewlet-below-content-description,#viewlet-below-content-title{display:none}.r-item-text{display:flex;flex-direction:column;margin:20px 30px;position:relative}.r-item-title{display:block}.r-results-numbers{margin-bottom:.5rem;width:100%}.r-results-numbers span{font-weight:700}.r-content-img{padding-bottom:60%}.new-content{margin:0 auto;max-width:700px}.r-load-more{margin-bottom:2rem;text-align:center}.r-load-more button{background:#000;border:1px solid #0000;border-radius:10px;border-bottom-left-radius:10px;border-bottom-left-radius:0;color:#fff;display:block;font-size:14px;font-weight:700;margin:0 auto;padding:.4rem 1rem}.r-load-more button:hover{background:rgba(0,0,0,.871)}.r-actu-wrapper{position:relative}.r-actu-wrapper:after{content:url(../57d3b7cb1ab874660b39.svg);display:block;position:absolute;right:0;top:0;transform:translateY(-20%);width:495px;z-index:-1}.r-actu-wrapper .r-list-item-group{background:#fff;border:1px solid #d1d1d1;border-radius:15px 15px 15px 0;margin:30px auto;max-width:900px}.r-item-title{font-size:18px;font-weight:700}.r-item-description{color:#444;font-size:16px;margin-top:10px}.r-item-img{border-radius:15px 15px 15px 0}.r-actu-wrapper .r-item-img{aspect-ratio:1.6741071429;background-position:top;background-repeat:no-repeat;background-size:cover;width:100%}@media screen and (min-width:775px){.r-actu-wrapper .r-item-img{width:323px}}.r-item-read-more{margin-top:auto}.r-item-arrow-more{align-self:center;background:#f9b331;background:url(../a38272f263f8328349f2.svg);background-position:50%;background-repeat:no-repeat;background-size:20px;border-radius:50px;flex:0 0 50px;height:50px;margin-left:auto;margin-right:30px;width:50px}.r-list-item-group:hover .r-item-arrow-more{background:url(../f79b479fdc5c0fe0d553.svg),#f9b331;background-position:50%;background-repeat:no-repeat;background-size:20px}@media screen and (max-width:600px){.r-list-item{flex-direction:column}.r-item-read-more{position:relative}}.icon-baseline{align-self:center;display:inline-flex;margin-right:.4rem}.icon-baseline svg{height:1em;position:relative;top:.125em;width:1em}.dpinlb{display:inline-block;vertical-align:top}.r-content-news-info-social svg{height:30px;width:30px}.r-content-news-info-social ul{align-items:center;display:flex;margin:0}.r-content-news-info-social ul li{list-style:none}.r-content-news-info-social ul li a:hover{opacity:.7}
1
+ .flexbin{display:flex;flex-wrap:wrap;margin:-2.5px;overflow:hidden}.flexbin:after{content:"";flex-grow:999999999;height:0;min-width:300px}.flexbin>*{display:block;flex-grow:1;height:300px;margin:2.5px;position:relative}.flexbin>*>img{height:300px;max-width:100%;min-width:100%;object-fit:cover;vertical-align:bottom}.flexbin.flexbin-margin{margin:2.5px}@media (max-width:980px){.flexbin{display:flex;flex-wrap:wrap;margin:-2.5px;overflow:hidden}.flexbin:after{content:"";flex-grow:999999999;height:0;min-width:150px}.flexbin>*{display:block;flex-grow:1;height:150px;margin:2.5px;position:relative}.flexbin>*>img{height:150px;max-width:100%;min-width:100%;object-fit:cover;vertical-align:bottom}.flexbin.flexbin-margin{margin:2.5px}}@media (max-width:400px){.flexbin{display:flex;flex-wrap:wrap;margin:-2.5px;overflow:hidden}.flexbin:after{content:"";flex-grow:999999999;height:0;min-width:100px}.flexbin>*{display:block;flex-grow:1;height:100px;margin:2.5px;position:relative}.flexbin>*>img{height:100px;max-width:100%;min-width:100%;object-fit:cover;vertical-align:bottom}.flexbin.flexbin-margin{margin:2.5px}}.breadcrumb{padding:0}.r-result-list{list-style:none;margin-top:50px;padding-left:0}#portal-column-content h1{font-size:0;position:absolute}#viewlet-below-content-description,#viewlet-below-content-title{display:none}.r-item-text{display:flex;flex-direction:column;margin:20px 30px;position:relative}.r-item-title{display:block}.r-results-numbers{margin-bottom:.5rem;width:100%}.r-results-numbers span{font-weight:700}.r-content-img{padding-bottom:60%}.new-content{margin:0 auto;max-width:700px}.r-load-more{margin-bottom:2rem;text-align:center}.r-load-more button{background:#000;border:1px solid #0000;border-radius:10px;border-bottom-left-radius:10px;border-bottom-left-radius:0;color:#fff;display:block;font-size:14px;font-weight:700;margin:0 auto;padding:.4rem 1rem}.r-load-more button:hover{background:rgba(0,0,0,.871)}.r-actu-wrapper{position:relative}.r-actu-wrapper:after{content:url(../57d3b7cb1ab874660b39.svg);display:block;position:absolute;right:0;top:0;transform:translateY(-20%);width:495px;z-index:-1}.r-actu-wrapper .r-list-item-group{background:#fff;border:1px solid #d1d1d1;border-radius:15px 15px 15px 0;margin:30px auto;max-width:900px}.r-item-title{font-size:18px;font-weight:700}.r-item-description{color:#444;font-size:16px;margin-top:10px}.r-item-img{border-radius:15px 15px 15px 0}.r-actu-wrapper .r-item-img{aspect-ratio:1.6741071429;background-position:top;background-repeat:no-repeat;background-size:cover;width:100%}@media screen and (min-width:775px){.r-actu-wrapper .r-item-img{width:323px}}.r-item-read-more{margin-top:auto}.r-item-arrow-more{align-self:center;background:#f9b331;background:url(../a38272f263f8328349f2.svg);background-position:50%;background-repeat:no-repeat;background-size:20px;border-radius:50px;flex:0 0 50px;height:50px;margin-left:auto;margin-right:30px;width:50px}.r-list-item-group:hover .r-item-arrow-more{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20.44 10'%3E%3Cg data-name='Calque 2'%3E%3Cg data-name='Calque 1'%3E%3Cpath d='M1 5h18.44' data-name='Ligne 7' style='fill:none;stroke:%23fff;stroke-linecap:round;stroke-width:2px'/%3E%3Cpath d='m14.83 1 4.61 4' data-name='Ligne 8' style='fill:none;stroke:%23fff;stroke-linecap:round;stroke-width:2px'/%3E%3Cpath d='m14.83 9 4.61-4' data-name='Ligne 9' style='fill:none;stroke:%23fff;stroke-linecap:round;stroke-width:2px'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),#f9b331;background-position:50%;background-repeat:no-repeat;background-size:20px}@media screen and (max-width:600px){.r-list-item{flex-direction:column}.r-item-read-more{position:relative}}.icon-baseline{align-self:center;display:inline-flex;margin-right:.4rem}.icon-baseline svg{height:1em;position:relative;top:.125em;width:1em}.dpinlb{display:inline-block;vertical-align:top}.r-content-news-info-social svg{height:30px;width:30px}.r-content-news-info-social ul{align-items:center;display:flex;margin:0}.r-content-news-info-social ul li{list-style:none}.r-content-news-info-social ul li a:hover{opacity:.7}.r-item-categorie{color:#747474;font-weight:400;margin-top:5px;text-transform:uppercase}