collective.tiles.carousel 1.0.4__py3-none-any.whl → 1.1.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.
@@ -23,13 +23,12 @@
23
23
 
24
24
  *** Settings *****************************************************************
25
25
 
26
- Resource plone/app/robotframework/selenium.robot
27
- Resource plone/app/robotframework/keywords.robot
26
+ Resource plone/app/robotframework/browser.robot
28
27
 
29
28
  Library Remote ${PLONE_URL}/RobotRemote
30
29
 
31
- Test Setup Open test browser
32
- Test Teardown Close all browsers
30
+ Test Setup Run keywords Plone Test Setup
31
+ Test Teardown Run keywords Plone Test Teardown
33
32
 
34
33
 
35
34
  *** Test Cases ***************************************************************
@@ -47,20 +46,19 @@ Scenario: As a member I want to be able to log into the website
47
46
 
48
47
  a login form
49
48
  Go To ${PLONE_URL}/login_form
50
- Wait until page contains Login Name
51
- Wait until page contains Password
49
+ Get Text //body contains Login Name
50
+ Get Text //body contains Password
52
51
 
53
52
 
54
53
  # --- WHEN -------------------------------------------------------------------
55
54
 
56
55
  I enter valid credentials
57
- Input Text __ac_name admin
58
- Input Text __ac_password secret
59
- Click Button Log in
56
+ Type Text //input[@name="__ac_name"] admin
57
+ Type Text //input[@name="__ac_password"] secret
58
+ Click //button[contains(text(), "Log in")]
60
59
 
61
60
 
62
61
  # --- THEN -------------------------------------------------------------------
63
62
 
64
63
  I am logged in
65
- Wait until page contains You are now logged in
66
- Page should contain You are now logged in
64
+ Get Text //body contains You are now logged in
@@ -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
@@ -8,7 +7,6 @@ from plone.app.contenttypes.browser.link_redirect_view import NON_RESOLVABLE_URL
8
7
  from plone.app.contenttypes.interfaces import ICollection
9
8
  from plone.app.contenttypes.utils import replace_link_variables_by_paths
10
9
  from plone.app.z3cform.widgets.querystring import QueryStringFieldWidget
11
- from plone.app.z3cform.widgets.relateditems import RelatedItemsFieldWidget
12
10
  from plone.autoform import directives as form
13
11
  from plone.dexterity.interfaces import IDexterityContainer
14
12
  from plone.memoize import view
@@ -30,6 +28,16 @@ from zope.schema.vocabulary import SimpleTerm
30
28
  from zope.schema.vocabulary import SimpleVocabulary
31
29
 
32
30
 
31
+ try:
32
+ from plone.app.z3cform.widgets.contentbrowser import (
33
+ ContentBrowserFieldWidget as CarouselItemsWidget,
34
+ )
35
+ except ImportError:
36
+ from plone.app.z3cform.widgets.relateditems import (
37
+ RelatedItemsFieldWidget as CarouselItemsWidget,
38
+ )
39
+
40
+
33
41
  @provider(IContextSourceBinder)
34
42
  def image_scales(context):
35
43
  """Return custom source for image scales.
@@ -74,11 +82,12 @@ class ISliderTile(Schema):
74
82
 
75
83
  form.widget(
76
84
  "carousel_items",
77
- RelatedItemsFieldWidget,
85
+ CarouselItemsWidget,
78
86
  vocabulary="plone.app.vocabularies.Catalog",
79
87
  pattern_options={
80
88
  "orderable": True,
81
89
  "recentlyUsed": True,
90
+ "upload": True,
82
91
  },
83
92
  )
84
93
 
@@ -247,50 +256,37 @@ class SliderTile(Tile):
247
256
 
248
257
  @property
249
258
  def items(self):
250
- items = OrderedDict()
259
+ result = []
260
+
251
261
  if len(self.data.get("carousel_items") or []):
252
262
  for item in self.data["carousel_items"]:
253
263
  if ICollection.providedBy(item.to_object):
254
- items.update(
255
- OrderedDict.fromkeys(
256
- [
257
- x.getObject()
258
- for x in item.to_object.results(
259
- brains=True, batch=False
260
- )
261
- ]
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,
262
275
  )
263
- )
264
- continue
265
- if IDexterityContainer.providedBy(item.to_object):
266
- items.update(
267
- OrderedDict.fromkeys(
268
- [
269
- x.getObject()
270
- for x in api.content.find(
271
- path="/".join(item.to_object.getPhysicalPath()),
272
- sort_on="getObjPositionInParent",
273
- depth=1,
274
- )
275
- ]
276
- )
277
- )
278
- continue
276
+ ]
279
277
  else:
280
- items[item.to_object] = None
278
+ result.append(item.to_object)
281
279
 
282
280
  query = self.query
281
+ limit = self.data.get("limit") or 12
282
+
283
283
  if query:
284
- items.update(
285
- OrderedDict.fromkeys([x.getObject() for x in self.catalog(**query)])
286
- )
284
+ # limit catalog query to our limit
285
+ query["sort_limit"] = limit
286
+ result += [x.getObject() for x in self.catalog(**query)]
287
287
 
288
- result = []
289
- limit = self.data.get("limit") or 12
290
- for count, obj in enumerate(items.keys(), 1):
291
- result.append(obj)
292
- if count >= limit:
293
- break
288
+ # limit result
289
+ result = result[:limit]
294
290
  ips = self.data.get("items_per_slide", 1) or 1
295
291
  slides = [
296
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.0.4
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
@@ -41,12 +41,24 @@ Requires-Dist: plone.tiles
41
41
  Requires-Dist: plone.api
42
42
  Requires-Dist: z3c.relationfield
43
43
  Provides-Extra: test
44
- Requires-Dist: plone.app.dexterity ; extra == 'test'
45
- Requires-Dist: plone.app.testing ; extra == 'test'
46
- Requires-Dist: plone.browserlayer ; extra == 'test'
47
- Requires-Dist: plone.testing ; extra == 'test'
48
- Requires-Dist: plone.app.robotframework[debug] ; extra == 'test'
49
- Requires-Dist: robotsuite ; extra == 'test'
44
+ Requires-Dist: plone.app.dexterity; extra == "test"
45
+ Requires-Dist: plone.app.testing; extra == "test"
46
+ Requires-Dist: plone.browserlayer; extra == "test"
47
+ Requires-Dist: plone.testing; extra == "test"
48
+ Requires-Dist: plone.app.robotframework[debug]; extra == "test"
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,23 @@ 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
+
133
+ 1.1.0 (2024-12-12)
134
+ ------------------
135
+
136
+ - Use new `ContentBrowserWidget` for Plone 6.1.
137
+ [petschki]
138
+
139
+
111
140
  1.0.4 (2024-05-02)
112
141
  ------------------
113
142
 
@@ -1,11 +1,11 @@
1
- collective.tiles.carousel-1.0.4-py3.11-nspkg.pth,sha256=2oWpeYM6MlxuTCe3-blu86w9h991-Etrc9-2Yn3D6ME,1059
1
+ collective.tiles.carousel-1.1.1-py3.13-nspkg.pth,sha256=2oWpeYM6MlxuTCe3-blu86w9h991-Etrc9-2Yn3D6ME,1059
2
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
- collective/tiles/carousel/tile.pt,sha256=ePFsqwYEMYpng21_l8Hp8Ok9-f_KfUKICaq-oJ3n3yc,4737
8
- collective/tiles/carousel/tile.py,sha256=lkl_R91n7h6Oh3X-2QWn-m7YfqnFioCS2WhhcGciyjQ,12230
7
+ collective/tiles/carousel/tile.pt,sha256=lf-v-icgXLqS88tjpf2BWs5l4BAvVQDJAAjURM26BN0,4782
8
+ collective/tiles/carousel/tile.py,sha256=CsEXPNCDh9f7-3EkB-tBU-ys7zdePiKjnbjSJiGO48c,11875
9
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
@@ -28,12 +28,12 @@ collective/tiles/carousel/slides/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeu
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
30
  collective/tiles/carousel/tests/test_setup.py,sha256=4FnSh4YBgEbcKTEw-feXs61FYm137R198GQUz4bXFBE,2221
31
- collective/tiles/carousel/tests/robot/test_example.robot,sha256=RjktU-NOhxH3xDxc_Tn91wLAVcuQQ2aNnMEV5oHOKFw,2032
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,,
31
+ collective/tiles/carousel/tests/robot/test_example.robot,sha256=5m94vuXTR8NH6qj1s52WlTCj-3Iwgy579yRFX0JG-UE,2053
32
+ collective_tiles_carousel-1.1.1.dist-info/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
33
+ collective_tiles_carousel-1.1.1.dist-info/LICENSE.rst,sha256=iDVL_6C7byshRvxykg-JJfnJl1UQCvKDV_H-1dp_8GU,668
34
+ collective_tiles_carousel-1.1.1.dist-info/METADATA,sha256=WG-tqdNH-Z-p9ci9Pb8SNVUWhtDDQPlwPikO4MloJmE,4535
35
+ collective_tiles_carousel-1.1.1.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
36
+ collective_tiles_carousel-1.1.1.dist-info/entry_points.txt,sha256=ru0hdDg0GqdaMNDkHf3l7rtXvCkgCOmh7S-EiRWIpUk,130
37
+ collective_tiles_carousel-1.1.1.dist-info/namespace_packages.txt,sha256=AiVC9ju6UYs_UE8dvyfAvQmRsFgWG25eyAfTG-nLAjM,28
38
+ collective_tiles_carousel-1.1.1.dist-info/top_level.txt,sha256=FyC0xnd95fkjCaKazR3nfIgNqhWMpB0mYBlzALyXKTg,11
39
+ collective_tiles_carousel-1.1.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5