plone.portlet.collection 4.0.0a4__py3-none-any.whl → 4.0.1__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.
@@ -1,42 +1,38 @@
1
- <html
2
- xmlns="http://www.w3.org/1999/xhtml"
3
- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
4
- xmlns:tal="http://xml.zope.org/namespaces/tal"
5
- tal:omit-tag=""
6
- >
1
+ <html xmlns="http://www.w3.org/1999/xhtml"
2
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
4
+ tal:omit-tag=""
5
+ >
7
6
 
8
- <div
9
- class="card portlet portletCollection"
10
- tal:define="
11
- collection_url view/collection_url;
12
- plone_view context/@@plone;
13
- toLocalizedTime nocall:plone_view/toLocalizedTime;
14
- viewActions python:context.portal_registry.get('plone.types_use_view_action_in_listings', []);
15
- icons nocall:context/@@iconresolver;
16
- normalizeString nocall:plone_view/normalizeString;
17
- "
18
- tal:attributes="
19
- class string:card portlet portletCollection ${view/css_class};
20
- "
21
- i18n:domain="plone"
22
- >
7
+ <div class="card portlet portletCollection"
8
+ tal:define="
9
+ collection_url view/collection_url;
10
+ plone_view context/@@plone;
11
+ toLocalizedTime nocall:plone_view/toLocalizedTime;
12
+ viewActions python:context.portal_registry.get('plone.types_use_view_action_in_listings', []);
13
+ icons nocall:context/@@iconresolver;
14
+ normalizeString nocall:plone_view/normalizeString;
15
+ "
16
+ tal:attributes="
17
+ class string:card portlet portletCollection ${view/css_class};
18
+ "
19
+ i18n:domain="plone"
20
+ >
23
21
 
24
22
  <div class="card-header">
25
- <a
26
- tal:omit-tag="not:view/data/show_more"
27
- tal:attributes="
28
- href collection_url;
29
- "
30
- >
31
- <span tal:content="view/data/header" />
23
+ <a tal:omit-tag="not:view/data/show_more"
24
+ tal:attributes="
25
+ href collection_url;
26
+ "
27
+ >
28
+ <span tal:content="view/data/header"></span>
32
29
  </a>
33
30
  </div>
34
31
 
35
32
  <div class="card-body">
36
33
  <ul>
37
34
  <tal:events tal:repeat="obj view/results">
38
- <li
39
- class="portletItem"
35
+ <li class="portletItem"
40
36
  tal:define="
41
37
  plone_layout context/@@plone_layout;
42
38
  portal context/@@plone_portal_state/portal;
@@ -56,58 +52,51 @@
56
52
  tal:attributes="
57
53
  class python:oddrow and 'portletItem even' or 'portletItem odd';
58
54
  "
59
- >
60
- <a
61
- href="#"
62
- tal:attributes="
63
- href itemUrl;
64
- class string:tile $item_type_class $item_wf_state_class;
65
- title obj/Description;
66
- "
67
- >
55
+ >
56
+ <a href="#"
57
+ tal:attributes="
58
+ href itemUrl;
59
+ class string:tile $item_type_class $item_wf_state_class;
60
+ title obj/Description;
61
+ "
62
+ >
68
63
 
69
- <tal:icon
70
- tal:condition="python: not supress_icon and item_type != 'File'"
71
- tal:replace="structure python:icons.tag(f'contenttype/{normalizeString(item_type)}')"
72
- />
73
- <tal:icon
74
- tal:condition="python: not supress_icon and item_type == 'File'"
75
- tal:replace="structure python:icons.tag(f'mimetype-{obj.mime_type}')"
76
- />
77
- <img
78
- tal:condition="python: obj.getIcon and thumb_scale and not supress_thumb"
79
- tal:replace="structure python:image_scale.tag(obj, 'image', scale=thumb_scale, css_class='float-end thumb-'+thumb_scale)"
80
- />
64
+ <tal:icon tal:condition="python: not supress_icon and item_type != 'File'"
65
+ tal:replace="structure python:icons.tag(f'contenttype/{normalizeString(item_type)}')"
66
+ />
67
+ <tal:icon tal:condition="python: not supress_icon and item_type == 'File'"
68
+ tal:replace="structure python:icons.tag(f'mimetype-{obj.mime_type}')"
69
+ />
70
+ <img tal:condition="python: obj.getIcon and thumb_scale and not supress_thumb"
71
+ tal:replace="structure python:image_scale.tag(obj, 'image', scale=thumb_scale, css_class='float-end thumb-'+thumb_scale)"
72
+ />
81
73
 
82
74
  <span tal:replace="obj/Title">Title</span>
83
75
  </a>
84
- <div
85
- class="portletItemDetails"
86
- tal:define="
87
- obj_date python:obj.start and obj.start or obj.Date();
88
- "
89
- tal:condition="view/data/show_dates"
90
- tal:content="python:toLocalizedTime(obj_date)"
91
- >May 5</div>
76
+ <div class="portletItemDetails"
77
+ tal:define="
78
+ obj_date python:obj.start and obj.start or obj.Date();
79
+ "
80
+ tal:condition="view/data/show_dates"
81
+ tal:content="python:toLocalizedTime(obj_date)"
82
+ >May 5</div>
92
83
  </li>
93
84
  </tal:events>
94
85
  </ul>
95
86
  </div>
96
87
 
97
- <div
98
- class="card-footer"
99
- tal:define="
100
- showMore view/data/show_more;
101
- "
102
- tal:condition="python:showMore or view.include_empty_footer()"
103
- >
104
- <a
105
- tal:condition="showMore"
106
- tal:attributes="
107
- href collection_url;
108
- "
109
- >
110
- <span class="hiddenStructure"><span tal:replace="view/data/header" />
88
+ <div class="card-footer"
89
+ tal:define="
90
+ showMore view/data/show_more;
91
+ "
92
+ tal:condition="python:showMore or view.include_empty_footer()"
93
+ >
94
+ <a tal:condition="showMore"
95
+ tal:attributes="
96
+ href collection_url;
97
+ "
98
+ >
99
+ <span class="hiddenStructure"><span tal:replace="view/data/header"></span>
111
100
  -
112
101
  </span>
113
102
  <span i18n:translate="more_url">More&hellip;</span>
@@ -1,18 +1,18 @@
1
1
  from ComputedAttribute import ComputedAttribute
2
- from plone.app.layout.navigation.root import getNavigationRoot
3
2
  from plone.app.portlets.browser import formhelper
4
3
  from plone.app.portlets.portlets import base
5
4
  from plone.app.uuid.utils import uuidToObject
6
5
  from plone.app.z3cform.widget import RelatedItemsFieldWidget
7
6
  from plone.autoform.directives import widget
7
+ from plone.base.defaultpage import is_default_page
8
+ from plone.base.interfaces.controlpanel import ISiteSchema
9
+ from plone.base.navigationroot import get_navigation_root
8
10
  from plone.i18n.normalizer.interfaces import IIDNormalizer
9
11
  from plone.memoize.instance import memoize
10
12
  from plone.portlet.collection import PloneMessageFactory as _
11
13
  from plone.portlets.interfaces import IPortletDataProvider
12
14
  from plone.registry.interfaces import IRegistry
13
15
  from Products.CMFCore.utils import getToolByName
14
- from Products.CMFPlone.defaultpage import is_default_page
15
- from Products.CMFPlone.interfaces.controlpanel import ISiteSchema
16
16
  from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
17
17
  from Products.MimetypesRegistry.MimeTypeItem import guess_icon_path
18
18
  from zExceptions import NotFound
@@ -24,23 +24,6 @@ import os
24
24
  import random
25
25
 
26
26
 
27
- COLLECTIONS = []
28
-
29
- try:
30
- from plone.app.collection.interfaces import ICollection
31
-
32
- COLLECTIONS.append(ICollection.__identifier__)
33
- except ImportError:
34
- pass
35
-
36
- try:
37
- from plone.app.contenttypes.interfaces import ICollection
38
-
39
- COLLECTIONS.append(ICollection.__identifier__)
40
- except ImportError:
41
- pass
42
-
43
-
44
27
  class ICollectionPortlet(IPortletDataProvider):
45
28
  """A portlet which renders the results of a collection object."""
46
29
 
@@ -310,7 +293,7 @@ class Renderer(base.Renderer):
310
293
 
311
294
  def getMimeTypeIcon(self, obj):
312
295
  fileo = obj.getObject().file
313
- portal_url = getNavigationRoot(self.context)
296
+ portal_url = get_navigation_root(self.context)
314
297
  mtt = getToolByName(self.context, "mimetypes_registry")
315
298
  if fileo.contentType:
316
299
  ctype = mtt.lookup(fileo.contentType)
@@ -3,32 +3,33 @@
3
3
  xmlns:five="http://namespaces.zope.org/five"
4
4
  xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
5
5
  xmlns:plone="http://namespaces.plone.org/plone"
6
- i18n_domain="plone">
6
+ i18n_domain="plone"
7
+ >
7
8
 
8
- <five:registerPackage package="." />
9
+ <five:registerPackage package="." />
9
10
 
10
- <genericsetup:registerProfile
11
- name="default"
12
- title="Collection portlet"
13
- directory="profiles/default"
14
- description="A simple portlet that displays the results of a collection object"
15
- provides="Products.GenericSetup.interfaces.EXTENSION"
16
- />
11
+ <genericsetup:registerProfile
12
+ name="default"
13
+ title="Collection portlet"
14
+ description="A simple portlet that displays the results of a collection object"
15
+ provides="Products.GenericSetup.interfaces.EXTENSION"
16
+ directory="profiles/default"
17
+ />
17
18
 
18
- <permission
19
- id="plone.portlet.collection.AddCollectionPortlet"
20
- title="plone.portlet.collection: Add collection portlet"
21
- />
19
+ <permission
20
+ id="plone.portlet.collection.AddCollectionPortlet"
21
+ title="plone.portlet.collection: Add collection portlet"
22
+ />
22
23
 
23
- <!-- Register the portlet -->
24
- <plone:portlet
25
- name="plone.portlet.collection.Collection"
26
- interface=".collection.ICollectionPortlet"
27
- assignment=".collection.Assignment"
28
- view_permission="zope2.View"
29
- edit_permission="plone.portlet.collection.AddCollectionPortlet"
30
- renderer=".collection.Renderer"
31
- addview=".collection.AddForm"
32
- editview=".collection.EditForm"
33
- />
24
+ <!-- Register the portlet -->
25
+ <plone:portlet
26
+ name="plone.portlet.collection.Collection"
27
+ interface=".collection.ICollectionPortlet"
28
+ assignment=".collection.Assignment"
29
+ renderer=".collection.Renderer"
30
+ addview=".collection.AddForm"
31
+ editview=".collection.EditForm"
32
+ view_permission="zope2.View"
33
+ edit_permission="plone.portlet.collection.AddCollectionPortlet"
34
+ />
34
35
  </configure>
@@ -1,4 +1,4 @@
1
- <?xml version="1.0"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <metadata>
3
3
  <version>1</version>
4
4
  <dependencies>
@@ -1,16 +1,14 @@
1
- <?xml version="1.0"?>
2
- <portlets
3
- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
4
- i18n:domain="plone">
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <portlets xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ i18n:domain="plone"
4
+ >
5
5
 
6
- <!-- Portlet type registrations -->
6
+ <!-- Portlet type registrations -->
7
7
 
8
- <portlet
9
- addview="plone.portlet.collection.Collection"
10
- title="Collection portlet"
11
- description="A portlet which displays the results of a collection query"
12
- i18n:attributes="title;
13
- description"
14
- />
8
+ <portlet addview="plone.portlet.collection.Collection"
9
+ description="A portlet which displays the results of a collection query"
10
+ title="Collection portlet"
11
+ i18n:attributes="title; description"
12
+ />
15
13
 
16
14
  </portlets>
@@ -10,7 +10,6 @@ from zope.configuration import xmlconfig
10
10
 
11
11
 
12
12
  class PlonePortletCollection(PloneSandboxLayer):
13
-
14
13
  defaultBases = (PLONE_FIXTURE,)
15
14
 
16
15
  def setUpZope(self, app, configurationContext):
@@ -19,7 +19,6 @@ import unittest
19
19
 
20
20
 
21
21
  class TestPortlet(unittest.TestCase):
22
-
23
22
  layer = PLONE_PORTLET_COLLECTION_INTEGRATION_TESTING
24
23
 
25
24
  def setUp(self):
@@ -72,7 +71,6 @@ class TestPortlet(unittest.TestCase):
72
71
 
73
72
 
74
73
  class TestRenderer(unittest.TestCase):
75
-
76
74
  layer = PLONE_PORTLET_COLLECTION_INTEGRATION_TESTING
77
75
 
78
76
  def setUp(self):
@@ -114,7 +112,6 @@ class TestRenderer(unittest.TestCase):
114
112
 
115
113
 
116
114
  class TestCollectionQuery(unittest.TestCase):
117
-
118
115
  layer = PLONE_PORTLET_COLLECTION_INTEGRATION_TESTING
119
116
 
120
117
  def setUp(self):
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plone.portlet.collection
3
- Version: 4.0.0a4
3
+ Version: 4.0.1
4
4
  Summary: A portlet that fetches results from a collection
5
5
  Home-page: https://pypi.org/project/plone.portlet.collection/
6
6
  Author: Plone Foundation
7
7
  Author-email: plone-developers@lists.sourceforge.net
8
8
  License: GPL version 2
9
9
  Keywords: collection portlet
10
- Platform: UNKNOWN
11
10
  Classifier: Development Status :: 5 - Production/Stable
12
11
  Classifier: Environment :: Web Environment
13
12
  Classifier: Framework :: Plone
@@ -17,17 +16,31 @@ Classifier: Framework :: Zope :: 5
17
16
  Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
18
17
  Classifier: Operating System :: OS Independent
19
18
  Classifier: Programming Language :: Python
20
- Classifier: Programming Language :: Python :: 3.7
21
19
  Classifier: Programming Language :: Python :: 3.8
22
20
  Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Requires-Python: >=3.8
23
24
  Requires-Dist: setuptools
25
+ Requires-Dist: ExtensionClass
26
+ Requires-Dist: plone.base
24
27
  Requires-Dist: plone.memoize
25
28
  Requires-Dist: plone.portlets
26
29
  Requires-Dist: plone.app.portlets
27
30
  Requires-Dist: plone.app.vocabularies
31
+ Requires-Dist: Products.GenericSetup
32
+ Requires-Dist: Products.MimetypesRegistry
33
+ Requires-Dist: plone.app.querystring
34
+ Requires-Dist: plone.app.uuid
35
+ Requires-Dist: plone.app.z3cform
36
+ Requires-Dist: plone.autoform
37
+ Requires-Dist: plone.i18n
38
+ Requires-Dist: plone.registry
28
39
  Provides-Extra: test
40
+ Requires-Dist: lxml ; extra == 'test'
41
+ Requires-Dist: plone.testing ; extra == 'test'
29
42
  Requires-Dist: plone.app.testing ; extra == 'test'
30
- Requires-Dist: plone.app.contenttypes ; extra == 'test'
43
+ Requires-Dist: plone.app.contenttypes[test] ; extra == 'test'
31
44
 
32
45
  Introduction
33
46
  ============
@@ -44,6 +57,26 @@ Changelog
44
57
 
45
58
  .. towncrier release notes start
46
59
 
60
+ 4.0.1 (2023-03-21)
61
+ ------------------
62
+
63
+ Internal:
64
+
65
+
66
+ - Update configuration files.
67
+ [plone devs] (a533099d)
68
+
69
+
70
+ 4.0.0 (2022-11-30)
71
+ ------------------
72
+
73
+ Bug fixes:
74
+
75
+
76
+ - Final release.
77
+ [gforcada] (#600)
78
+
79
+
47
80
  4.0.0a4 (2022-05-24)
48
81
  --------------------
49
82
 
@@ -171,7 +204,7 @@ Bug fixes:
171
204
 
172
205
  New features:
173
206
 
174
- - add options to supress icons,
207
+ - add options to suppress icons,
175
208
  read thumb_scale from registry plus option to override thumb_scale individually
176
209
  or suppress thumbs.
177
210
  Replace paper clip (fontello icon) with mimetype icon
@@ -511,5 +544,3 @@ Fixes:
511
544
 
512
545
  - First public release
513
546
  [baekholt, wichert]
514
-
515
-
@@ -0,0 +1,17 @@
1
+ plone.portlet.collection-4.0.1-py3.11-nspkg.pth,sha256=r1m-rTMO7wKwUjoyiU_2tLHz91gBKwcHdWFnGsDc5Bg,1694
2
+ plone/portlet/collection/__init__.py,sha256=AsIAzr6zWnHPtFi3Mc3VWEpRan8WmpyUN5mIOO7DCdw,395
3
+ plone/portlet/collection/collection.pt,sha256=vSiGkk5CrZiAqEjPt0OQiXBaIll2LqqmRYil1smpaiI,3986
4
+ plone/portlet/collection/collection.py,sha256=ZsPd_4ymAoxQqWArVt2jAyjiHUwsiMTTornReTjC8D0,10066
5
+ plone/portlet/collection/configure.zcml,sha256=hCCtjVQ9kJFu_0A5EGHJPx0K1ZpOFdmCQ3MKL7X-1Kc,1141
6
+ plone/portlet/collection/testing.py,sha256=-N854wz9bQlZ4d5qctkgGqhdTzpsayfeTyEBHh0pqjY,1501
7
+ plone/portlet/collection/profiles/default/metadata.xml,sha256=c7SrYDntD4P95ZYT1Ak0oXCzXfSxM3xz2JGHgJwMzSc,187
8
+ plone/portlet/collection/profiles/default/portlets.xml,sha256=ByEJ1wcptpk8Ku1yAyaxO7MgCS9AkHsVMwLAm3R8vSA,415
9
+ plone/portlet/collection/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ plone/portlet/collection/tests/functional.txt,sha256=rN_jxz_PadvHnku_njsljf8CSYf7nG1dgeb7cLyCnkc,5970
11
+ plone/portlet/collection/tests/test_functional_doctest.py,sha256=xJM6ae6_pHdEvalMigE6pZ1psUe_ZaZIeP_2MIBKfAM,947
12
+ plone/portlet/collection/tests/test_portlet_collection.py,sha256=DMRUEOPl-3IGELjiLAtrSsNEi61RyHP6K2e4Mx15MxA,16311
13
+ plone.portlet.collection-4.0.1.dist-info/METADATA,sha256=V5H78Mv__oUAXZEpW6s5lcW4h0UTDn8SVs2rgJUyXFI,10906
14
+ plone.portlet.collection-4.0.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
15
+ plone.portlet.collection-4.0.1.dist-info/namespace_packages.txt,sha256=EkWaD5YnUkFD6PsA2Jfm4YGVygbvoud8ntS7-EfOD2Q,20
16
+ plone.portlet.collection-4.0.1.dist-info/top_level.txt,sha256=56bqrkG-vurYD0l15D71FPiDL7L3QqkfRWkYkdyS7WM,6
17
+ plone.portlet.collection-4.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.38.4)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,17 +0,0 @@
1
- plone.portlet.collection-4.0.0a4-py3.10-nspkg.pth,sha256=r1m-rTMO7wKwUjoyiU_2tLHz91gBKwcHdWFnGsDc5Bg,1694
2
- plone/portlet/collection/__init__.py,sha256=AsIAzr6zWnHPtFi3Mc3VWEpRan8WmpyUN5mIOO7DCdw,395
3
- plone/portlet/collection/collection.pt,sha256=YmoNUhbKYgG5ACBmVJm71gCrEIuQhN8TgcRse_JsqHA,4129
4
- plone/portlet/collection/collection.py,sha256=m-vBkpZIYwYDKprICl_WDV1VsHsgB3z9QKX_pwyL1rk,10398
5
- plone/portlet/collection/configure.zcml,sha256=l6m7Bu4nyLsmv4sgYFt33EsQ-fXGKxul7RLoBW4Tbzc,1185
6
- plone/portlet/collection/testing.py,sha256=KOacD3Yxdo0XnxsIe_1nB58P9IPvO_g4hrM8uIX5Jvw,1502
7
- plone/portlet/collection/profiles/default/metadata.xml,sha256=pFEbjHjJtie62YikcRCUkP1XJh4DnTBtQTvlSiFYh_Q,170
8
- plone/portlet/collection/profiles/default/portlets.xml,sha256=5oruthgrYRKhLAMDzUQnxcZAEszWGeLlVGQu3qLXKeA,393
9
- plone/portlet/collection/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- plone/portlet/collection/tests/functional.txt,sha256=rN_jxz_PadvHnku_njsljf8CSYf7nG1dgeb7cLyCnkc,5970
11
- plone/portlet/collection/tests/test_functional_doctest.py,sha256=xJM6ae6_pHdEvalMigE6pZ1psUe_ZaZIeP_2MIBKfAM,947
12
- plone/portlet/collection/tests/test_portlet_collection.py,sha256=HVDO5ng90_Mih76vRFjp04Bo07TsZSyRTHvlS1H3f-E,16314
13
- plone.portlet.collection-4.0.0a4.dist-info/METADATA,sha256=7gslsfhGfYJoL7LH9H9cbZ24KhqrcpPWMb15s36tjdk,10240
14
- plone.portlet.collection-4.0.0a4.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
15
- plone.portlet.collection-4.0.0a4.dist-info/namespace_packages.txt,sha256=EkWaD5YnUkFD6PsA2Jfm4YGVygbvoud8ntS7-EfOD2Q,20
16
- plone.portlet.collection-4.0.0a4.dist-info/top_level.txt,sha256=56bqrkG-vurYD0l15D71FPiDL7L3QqkfRWkYkdyS7WM,6
17
- plone.portlet.collection-4.0.0a4.dist-info/RECORD,,