collective.tiles.carousel 1.0.3__py3-none-any.whl → 1.0.4__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.
- collective/tiles/carousel/__init__.py +1 -0
- collective/tiles/carousel/tests/test_setup.py +1 -0
- collective/tiles/carousel/tile.py +10 -37
- collective/tiles/carousel/utils.py +6 -20
- collective.tiles.carousel-1.0.4-py3.11-nspkg.pth +2 -0
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/METADATA +11 -1
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/RECORD +13 -13
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/WHEEL +1 -1
- collective.tiles.carousel-1.0.3-py3.11-nspkg.pth +0 -3
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/LICENSE.GPL +0 -0
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/LICENSE.rst +0 -0
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/entry_points.txt +0 -0
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/namespace_packages.txt +0 -0
- {collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/top_level.txt +0 -0
@@ -7,8 +7,6 @@ from plone import api
|
|
7
7
|
from plone.app.contenttypes.browser.link_redirect_view import NON_RESOLVABLE_URL_SCHEMES
|
8
8
|
from plone.app.contenttypes.interfaces import ICollection
|
9
9
|
from plone.app.contenttypes.utils import replace_link_variables_by_paths
|
10
|
-
from plone.app.querystring import queryparser
|
11
|
-
from plone.app.querystring.interfaces import IParsedQueryIndexModifier
|
12
10
|
from plone.app.z3cform.widgets.querystring import QueryStringFieldWidget
|
13
11
|
from plone.app.z3cform.widgets.relateditems import RelatedItemsFieldWidget
|
14
12
|
from plone.autoform import directives as form
|
@@ -22,7 +20,6 @@ from z3c.relationfield.schema import RelationChoice
|
|
22
20
|
from z3c.relationfield.schema import RelationList
|
23
21
|
from zope import schema
|
24
22
|
from zope.component import getMultiAdapter
|
25
|
-
from zope.component import getUtilitiesFor
|
26
23
|
from zope.component import getUtility
|
27
24
|
from zope.interface import alsoProvides
|
28
25
|
from zope.interface import implementer
|
@@ -248,37 +245,10 @@ class SliderTile(Tile):
|
|
248
245
|
values.append(name)
|
249
246
|
return values
|
250
247
|
|
251
|
-
def parse_query_from_data(data, context=None):
|
252
|
-
"""Parse query from data dictionary"""
|
253
|
-
if context is None:
|
254
|
-
context = api.portal.get()
|
255
|
-
query = data.get("query", {}) or {}
|
256
|
-
try:
|
257
|
-
parsed = queryparser.parseFormquery(context, query)
|
258
|
-
except KeyError:
|
259
|
-
parsed = {}
|
260
|
-
|
261
|
-
index_modifiers = getUtilitiesFor(IParsedQueryIndexModifier)
|
262
|
-
for name, modifier in index_modifiers:
|
263
|
-
if name in parsed:
|
264
|
-
new_name, query = modifier(parsed[name])
|
265
|
-
parsed[name] = query
|
266
|
-
# if a new index name has been returned, we need to replace
|
267
|
-
# the native ones
|
268
|
-
if name != new_name:
|
269
|
-
del parsed[name]
|
270
|
-
parsed[new_name] = query
|
271
|
-
|
272
|
-
if data.get("sort_on"):
|
273
|
-
parsed["sort_on"] = data["sort_on"]
|
274
|
-
if data.get("sort_reversed", False):
|
275
|
-
parsed["sort_order"] = "reverse"
|
276
|
-
return parsed
|
277
|
-
|
278
248
|
@property
|
279
249
|
def items(self):
|
280
250
|
items = OrderedDict()
|
281
|
-
if "carousel_items"
|
251
|
+
if len(self.data.get("carousel_items") or []):
|
282
252
|
for item in self.data["carousel_items"]:
|
283
253
|
if ICollection.providedBy(item.to_object):
|
284
254
|
items.update(
|
@@ -309,16 +279,19 @@ class SliderTile(Tile):
|
|
309
279
|
else:
|
310
280
|
items[item.to_object] = None
|
311
281
|
|
312
|
-
|
282
|
+
query = self.query
|
283
|
+
if query:
|
313
284
|
items.update(
|
314
|
-
OrderedDict.fromkeys(
|
315
|
-
[x.getObject() for x in api.content.find(**self.query)]
|
316
|
-
)
|
285
|
+
OrderedDict.fromkeys([x.getObject() for x in self.catalog(**query)])
|
317
286
|
)
|
287
|
+
|
318
288
|
result = []
|
319
|
-
|
289
|
+
limit = self.data.get("limit") or 12
|
290
|
+
for count, obj in enumerate(items.keys(), 1):
|
320
291
|
result.append(obj)
|
321
|
-
|
292
|
+
if count >= limit:
|
293
|
+
break
|
294
|
+
ips = self.data.get("items_per_slide", 1) or 1
|
322
295
|
slides = [
|
323
296
|
result[i : i + ips]
|
324
297
|
for i in [x * ips for x in range(0, int(len(result) / ips) + int(1))]
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
from plone import api
|
4
4
|
from plone.app.querystring import queryparser
|
5
|
-
from plone.app.querystring.interfaces import IParsedQueryIndexModifier
|
6
|
-
from zope.component import getUtilitiesFor
|
7
5
|
|
8
6
|
|
9
7
|
def parse_query_from_data(data, context=None):
|
@@ -12,25 +10,13 @@ def parse_query_from_data(data, context=None):
|
|
12
10
|
context = api.portal.get()
|
13
11
|
query = data.get("query", {}) or {}
|
14
12
|
try:
|
15
|
-
parsed = queryparser.
|
13
|
+
parsed = queryparser.parseAndModifyFormquery(
|
14
|
+
context,
|
15
|
+
query,
|
16
|
+
data.get("sort_on"),
|
17
|
+
"desc" if data.get("sort_reversed", False) else "asc",
|
18
|
+
)
|
16
19
|
except KeyError:
|
17
20
|
parsed = {}
|
18
21
|
|
19
|
-
index_modifiers = getUtilitiesFor(IParsedQueryIndexModifier)
|
20
|
-
for name, modifier in index_modifiers:
|
21
|
-
if name in parsed:
|
22
|
-
new_name, query = modifier(parsed[name])
|
23
|
-
parsed[name] = query
|
24
|
-
# if a new index name has been returned, we need to replace
|
25
|
-
# the native ones
|
26
|
-
if name != new_name:
|
27
|
-
del parsed[name]
|
28
|
-
parsed[new_name] = query
|
29
|
-
|
30
|
-
if data.get("sort_on"):
|
31
|
-
parsed["sort_on"] = data["sort_on"]
|
32
|
-
if data.get("limit"):
|
33
|
-
parsed["sort_limit"] = data["limit"]
|
34
|
-
if data.get("sort_reversed", False):
|
35
|
-
parsed["sort_order"] = "reverse"
|
36
22
|
return parsed
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import sys, types, os;p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('collective',));importlib = __import__('importlib.util');__import__('importlib.machinery');m = sys.modules.setdefault('collective', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('collective', [os.path.dirname(p)])));m = m or sys.modules.setdefault('collective', types.ModuleType('collective'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p)
|
2
|
+
import sys, types, os;p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('collective', 'tiles'));importlib = __import__('importlib.util');__import__('importlib.machinery');m = sys.modules.setdefault('collective.tiles', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('collective.tiles', [os.path.dirname(p)])));m = m or sys.modules.setdefault('collective.tiles', types.ModuleType('collective.tiles'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p);m and setattr(sys.modules['collective'], 'tiles', m)
|
{collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: collective.tiles.carousel
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.4
|
4
4
|
Summary: Slider for plone.app.mosaic based on Bootstrap 5
|
5
5
|
Home-page: https://github.com/collective/collective.tiles.carousel
|
6
6
|
Author: Peter Holzer
|
@@ -108,6 +108,16 @@ Changelog
|
|
108
108
|
=========
|
109
109
|
|
110
110
|
|
111
|
+
1.0.4 (2024-05-02)
|
112
|
+
------------------
|
113
|
+
|
114
|
+
- Fix ``limit``.
|
115
|
+
[petschki]
|
116
|
+
|
117
|
+
- code cleanup.
|
118
|
+
[petschki]
|
119
|
+
|
120
|
+
|
111
121
|
1.0.3 (2023-11-03)
|
112
122
|
------------------
|
113
123
|
|
{collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/RECORD
RENAMED
@@ -1,12 +1,12 @@
|
|
1
|
-
collective.tiles.carousel-1.0.
|
2
|
-
collective/tiles/carousel/__init__.py,sha256=
|
1
|
+
collective.tiles.carousel-1.0.4-py3.11-nspkg.pth,sha256=2oWpeYM6MlxuTCe3-blu86w9h991-Etrc9-2Yn3D6ME,1059
|
2
|
+
collective/tiles/carousel/__init__.py,sha256=51V59Yi1aRW6PCzRAoJqUlWno0YQO1wAgi8d37mwTmA,119
|
3
3
|
collective/tiles/carousel/configure.zcml,sha256=1-9Nc4-Lej7b7HJb9Puc8Jw_rDRVyS6agix2SR98wrs,1783
|
4
4
|
collective/tiles/carousel/interfaces.py,sha256=erGd_4DSscSVyQCdzdWNABmPxuUBV1vwKvz6_m5BCc4,249
|
5
5
|
collective/tiles/carousel/setuphandlers.py,sha256=0y1cT8R_eYSdIv-aZUY-pazUGia27EFzCCHC-SiGMrI,586
|
6
6
|
collective/tiles/carousel/testing.py,sha256=WxBe18FLBdf-9nQmw_0rL_Gf1Eu0aLnUDD0RUxJ2VE0,1685
|
7
7
|
collective/tiles/carousel/tile.pt,sha256=ePFsqwYEMYpng21_l8Hp8Ok9-f_KfUKICaq-oJ3n3yc,4737
|
8
|
-
collective/tiles/carousel/tile.py,sha256=
|
9
|
-
collective/tiles/carousel/utils.py,sha256=
|
8
|
+
collective/tiles/carousel/tile.py,sha256=lkl_R91n7h6Oh3X-2QWn-m7YfqnFioCS2WhhcGciyjQ,12230
|
9
|
+
collective/tiles/carousel/utils.py,sha256=M0fOW-m5fhe63I4PtO8jCqnbooZ9ZXctj5in_Ru8j-o,550
|
10
10
|
collective/tiles/carousel/locales/README.rst,sha256=fS2h1MYp7b5Im-GcnIsZLHhK1N4F-_VuHBf_DorI2_A,611
|
11
11
|
collective/tiles/carousel/locales/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
collective/tiles/carousel/locales/collective.tiles.carousel.pot,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -27,13 +27,13 @@ collective/tiles/carousel/slides/slide_view.py,sha256=CiDVVWD_Vcm1JDjruPoR5wJ83g
|
|
27
27
|
collective/tiles/carousel/slides/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
28
|
collective/tiles/carousel/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
29
|
collective/tiles/carousel/tests/test_robot.py,sha256=VPu3DguHGk-5srPM-N9BZj4dALjotYup8RWZ-QRdbpQ,947
|
30
|
-
collective/tiles/carousel/tests/test_setup.py,sha256=
|
30
|
+
collective/tiles/carousel/tests/test_setup.py,sha256=4FnSh4YBgEbcKTEw-feXs61FYm137R198GQUz4bXFBE,2221
|
31
31
|
collective/tiles/carousel/tests/robot/test_example.robot,sha256=RjktU-NOhxH3xDxc_Tn91wLAVcuQQ2aNnMEV5oHOKFw,2032
|
32
|
-
collective.tiles.carousel-1.0.
|
33
|
-
collective.tiles.carousel-1.0.
|
34
|
-
collective.tiles.carousel-1.0.
|
35
|
-
collective.tiles.carousel-1.0.
|
36
|
-
collective.tiles.carousel-1.0.
|
37
|
-
collective.tiles.carousel-1.0.
|
38
|
-
collective.tiles.carousel-1.0.
|
39
|
-
collective.tiles.carousel-1.0.
|
32
|
+
collective.tiles.carousel-1.0.4.dist-info/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
33
|
+
collective.tiles.carousel-1.0.4.dist-info/LICENSE.rst,sha256=iDVL_6C7byshRvxykg-JJfnJl1UQCvKDV_H-1dp_8GU,668
|
34
|
+
collective.tiles.carousel-1.0.4.dist-info/METADATA,sha256=58tQmNcfVHw1njopS1Y5WhOUJ6oq3C_DsoFBP3ipm90,4028
|
35
|
+
collective.tiles.carousel-1.0.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
36
|
+
collective.tiles.carousel-1.0.4.dist-info/entry_points.txt,sha256=ru0hdDg0GqdaMNDkHf3l7rtXvCkgCOmh7S-EiRWIpUk,130
|
37
|
+
collective.tiles.carousel-1.0.4.dist-info/namespace_packages.txt,sha256=AiVC9ju6UYs_UE8dvyfAvQmRsFgWG25eyAfTG-nLAjM,28
|
38
|
+
collective.tiles.carousel-1.0.4.dist-info/top_level.txt,sha256=FyC0xnd95fkjCaKazR3nfIgNqhWMpB0mYBlzALyXKTg,11
|
39
|
+
collective.tiles.carousel-1.0.4.dist-info/RECORD,,
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import sys, types, os;has_mfs = sys.version_info > (3, 5);p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('collective',));importlib = has_mfs and __import__('importlib.util');has_mfs and __import__('importlib.machinery');m = has_mfs and sys.modules.setdefault('collective', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('collective', [os.path.dirname(p)])));m = m or sys.modules.setdefault('collective', types.ModuleType('collective'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p)
|
2
|
-
import sys, types, os;has_mfs = sys.version_info > (3, 5);p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('collective',));importlib = has_mfs and __import__('importlib.util');has_mfs and __import__('importlib.machinery');m = has_mfs and sys.modules.setdefault('collective', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('collective', [os.path.dirname(p)])));m = m or sys.modules.setdefault('collective', types.ModuleType('collective'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p)
|
3
|
-
import sys, types, os;has_mfs = sys.version_info > (3, 5);p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('collective', 'tiles'));importlib = has_mfs and __import__('importlib.util');has_mfs and __import__('importlib.machinery');m = has_mfs and sys.modules.setdefault('collective.tiles', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('collective.tiles', [os.path.dirname(p)])));m = m or sys.modules.setdefault('collective.tiles', types.ModuleType('collective.tiles'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p);m and setattr(sys.modules['collective'], 'tiles', m)
|
{collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/LICENSE.GPL
RENAMED
File without changes
|
{collective.tiles.carousel-1.0.3.dist-info → collective.tiles.carousel-1.0.4.dist-info}/LICENSE.rst
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|