collective.tiles.carousel 1.1.0__tar.gz → 1.1.1__tar.gz

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 (53) hide show
  1. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/CHANGES.rst +10 -0
  2. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/PKG-INFO +24 -2
  3. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/setup.py +1 -1
  4. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/tile.pt +4 -5
  5. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/tile.py +22 -36
  6. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/PKG-INFO +24 -2
  7. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/CONTRIBUTORS.rst +0 -0
  8. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/DEVELOP.rst +0 -0
  9. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/LICENSE.GPL +0 -0
  10. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/LICENSE.rst +0 -0
  11. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/README.rst +0 -0
  12. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/constraints.txt +0 -0
  13. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/docs/conf.py +0 -0
  14. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/docs/index.rst +0 -0
  15. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/requirements.txt +0 -0
  16. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/setup.cfg +0 -0
  17. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/__init__.py +0 -0
  18. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/__init__.py +0 -0
  19. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/__init__.py +0 -0
  20. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/configure.zcml +0 -0
  21. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/interfaces.py +0 -0
  22. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/locales/README.rst +0 -0
  23. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/locales/__init__.py +0 -0
  24. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/locales/collective.tiles.carousel.pot +0 -0
  25. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/locales/en/LC_MESSAGES/collective.tiles.carousel.mo +0 -0
  26. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/locales/en/LC_MESSAGES/collective.tiles.carousel.po +0 -0
  27. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/locales/update.py +0 -0
  28. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/locales/update.sh +0 -0
  29. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/profiles/default/browserlayer.xml +0 -0
  30. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/profiles/default/metadata.xml +0 -0
  31. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/profiles/default/registry/mosaic.xml +0 -0
  32. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/profiles/uninstall/browserlayer.xml +0 -0
  33. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/setuphandlers.py +0 -0
  34. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/slides/__init__.py +0 -0
  35. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/slides/configure.zcml +0 -0
  36. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/slides/slide_full_view.pt +0 -0
  37. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/slides/slide_full_view.py +0 -0
  38. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/slides/slide_view.pt +0 -0
  39. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/slides/slide_view.py +0 -0
  40. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/slides/static/.gitkeep +0 -0
  41. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/testing.py +0 -0
  42. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/tests/__init__.py +0 -0
  43. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/tests/robot/test_example.robot +0 -0
  44. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/tests/test_robot.py +0 -0
  45. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/tests/test_setup.py +0 -0
  46. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective/tiles/carousel/utils.py +0 -0
  47. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/SOURCES.txt +0 -0
  48. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/dependency_links.txt +0 -0
  49. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/entry_points.txt +0 -0
  50. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/namespace_packages.txt +0 -0
  51. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/not-zip-safe +0 -0
  52. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/requires.txt +0 -0
  53. {collective_tiles_carousel-1.1.0 → collective_tiles_carousel-1.1.1}/src/collective.tiles.carousel.egg-info/top_level.txt +0 -0
@@ -2,6 +2,16 @@ Changelog
2
2
  =========
3
3
 
4
4
 
5
+ 1.1.1 (2025-05-09)
6
+ ------------------
7
+
8
+ - Show indicators and controls only if there are more than one slide.
9
+ [petschki]
10
+
11
+ - Improve result calculation.
12
+ [petschki]
13
+
14
+
5
15
  1.1.0 (2024-12-12)
6
16
  ------------------
7
17
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: collective.tiles.carousel
3
- Version: 1.1.0
3
+ Version: 1.1.1
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
@@ -47,6 +47,18 @@ Requires-Dist: plone.browserlayer; extra == "test"
47
47
  Requires-Dist: plone.testing; extra == "test"
48
48
  Requires-Dist: plone.app.robotframework[debug]; extra == "test"
49
49
  Requires-Dist: robotsuite; extra == "test"
50
+ Dynamic: author
51
+ Dynamic: author-email
52
+ Dynamic: classifier
53
+ Dynamic: description
54
+ Dynamic: home-page
55
+ Dynamic: keywords
56
+ Dynamic: license
57
+ Dynamic: project-url
58
+ Dynamic: provides-extra
59
+ Dynamic: requires-dist
60
+ Dynamic: requires-python
61
+ Dynamic: summary
50
62
 
51
63
  .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
52
64
  If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
@@ -108,6 +120,16 @@ Changelog
108
120
  =========
109
121
 
110
122
 
123
+ 1.1.1 (2025-05-09)
124
+ ------------------
125
+
126
+ - Show indicators and controls only if there are more than one slide.
127
+ [petschki]
128
+
129
+ - Improve result calculation.
130
+ [petschki]
131
+
132
+
111
133
  1.1.0 (2024-12-12)
112
134
  ------------------
113
135
 
@@ -15,7 +15,7 @@ long_description = "\n\n".join(
15
15
 
16
16
  setup(
17
17
  name="collective.tiles.carousel",
18
- version="1.1.0",
18
+ version="1.1.1",
19
19
  description="Slider for plone.app.mosaic based on Bootstrap 5",
20
20
  long_description=long_description,
21
21
  # Get more from https://pypi.org/classifiers/
@@ -13,12 +13,11 @@
13
13
  darkvariant python:view.data.get('darkvariant') and 'carousel-dark' or '';
14
14
  crossfade python:view.data.get('crossfade') and 'carousel-fade' or '';
15
15
  link_slides python:view.data.get('link_slides') != 'disabled';
16
- items_per_slide python:view.data.get('items_per_slide') and view.data.get('items_per_slide') or 1;
16
+ items_per_slide python:view.data.get('items_per_slide', 1) or 1;
17
17
  items_responsive python: items_per_slide > 1 and 'row-cols-2' or 'row-cols-1';
18
18
  items_responsive python: items_per_slide == 3 and 'row-cols-1' or items_responsive;
19
19
  autoplay_interval view/data/carousel_speed|nothing;
20
20
  ">
21
-
22
21
  <div class="tileHeader"
23
22
  tal:condition="python:view.data['title'] or view.data['description']"
24
23
  >
@@ -41,7 +40,7 @@
41
40
  >
42
41
 
43
42
  <div class="carousel-indicators"
44
- tal:condition="view/data/indicators"
43
+ tal:condition="python:view.data.get('indicators')"
45
44
  >
46
45
  <tal:indicators repeat="item items">
47
46
  <button class="${python:repeat.item.index == 0 and 'active' or None}"
@@ -82,7 +81,7 @@
82
81
  href="#carousel-${view/id}"
83
82
  role="button"
84
83
  data-bs-slide="prev"
85
- tal:condition="view/data/controls"
84
+ tal:condition="python:view.data.get('controls') and len(items) > 1"
86
85
  >
87
86
  <span class="carousel-control-prev-icon"
88
87
  aria-hidden="true"
@@ -95,7 +94,7 @@
95
94
  href="#carousel-${view/id}"
96
95
  role="button"
97
96
  data-bs-slide="next"
98
- tal:condition="view/data/controls"
97
+ tal:condition="python:view.data.get('controls') and len(items) > 1"
99
98
  >
100
99
  <span class="carousel-control-next-icon"
101
100
  aria-hidden="true"
@@ -1,4 +1,3 @@
1
- from collections import OrderedDict
2
1
  from collective.tiles.carousel import _
3
2
  from collective.tiles.carousel.interfaces import ICollectiveTilesCarouselLayer
4
3
  from collective.tiles.carousel.utils import parse_query_from_data
@@ -257,50 +256,37 @@ class SliderTile(Tile):
257
256
 
258
257
  @property
259
258
  def items(self):
260
- items = OrderedDict()
259
+ result = []
260
+
261
261
  if len(self.data.get("carousel_items") or []):
262
262
  for item in self.data["carousel_items"]:
263
263
  if ICollection.providedBy(item.to_object):
264
- items.update(
265
- OrderedDict.fromkeys(
266
- [
267
- x.getObject()
268
- for x in item.to_object.results(
269
- brains=True, batch=False
270
- )
271
- ]
264
+ result += [
265
+ x.getObject()
266
+ for x in item.to_object.results(brains=True, batch=False)
267
+ ]
268
+ elif IDexterityContainer.providedBy(item.to_object):
269
+ result += [
270
+ x.getObject()
271
+ for x in api.content.find(
272
+ path="/".join(item.to_object.getPhysicalPath()),
273
+ sort_on="getObjPositionInParent",
274
+ depth=1,
272
275
  )
273
- )
274
- continue
275
- if IDexterityContainer.providedBy(item.to_object):
276
- items.update(
277
- OrderedDict.fromkeys(
278
- [
279
- x.getObject()
280
- for x in api.content.find(
281
- path="/".join(item.to_object.getPhysicalPath()),
282
- sort_on="getObjPositionInParent",
283
- depth=1,
284
- )
285
- ]
286
- )
287
- )
288
- continue
276
+ ]
289
277
  else:
290
- items[item.to_object] = None
278
+ result.append(item.to_object)
291
279
 
292
280
  query = self.query
281
+ limit = self.data.get("limit") or 12
282
+
293
283
  if query:
294
- items.update(
295
- OrderedDict.fromkeys([x.getObject() for x in self.catalog(**query)])
296
- )
284
+ # limit catalog query to our limit
285
+ query["sort_limit"] = limit
286
+ result += [x.getObject() for x in self.catalog(**query)]
297
287
 
298
- result = []
299
- limit = self.data.get("limit") or 12
300
- for count, obj in enumerate(items.keys(), 1):
301
- result.append(obj)
302
- if count >= limit:
303
- break
288
+ # limit result
289
+ result = result[:limit]
304
290
  ips = self.data.get("items_per_slide", 1) or 1
305
291
  slides = [
306
292
  result[i : i + ips]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: collective.tiles.carousel
3
- Version: 1.1.0
3
+ Version: 1.1.1
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
@@ -47,6 +47,18 @@ Requires-Dist: plone.browserlayer; extra == "test"
47
47
  Requires-Dist: plone.testing; extra == "test"
48
48
  Requires-Dist: plone.app.robotframework[debug]; extra == "test"
49
49
  Requires-Dist: robotsuite; extra == "test"
50
+ Dynamic: author
51
+ Dynamic: author-email
52
+ Dynamic: classifier
53
+ Dynamic: description
54
+ Dynamic: home-page
55
+ Dynamic: keywords
56
+ Dynamic: license
57
+ Dynamic: project-url
58
+ Dynamic: provides-extra
59
+ Dynamic: requires-dist
60
+ Dynamic: requires-python
61
+ Dynamic: summary
50
62
 
51
63
  .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
52
64
  If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
@@ -108,6 +120,16 @@ Changelog
108
120
  =========
109
121
 
110
122
 
123
+ 1.1.1 (2025-05-09)
124
+ ------------------
125
+
126
+ - Show indicators and controls only if there are more than one slide.
127
+ [petschki]
128
+
129
+ - Improve result calculation.
130
+ [petschki]
131
+
132
+
111
133
  1.1.0 (2024-12-12)
112
134
  ------------------
113
135