diff --git a/.jshintignore b/.jshintignore
index 03eacf687..abc8f0269 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -2,3 +2,4 @@ src/collective/cover/static/bootstrap.min.js
src/collective/cover/static/jquery.*
src/collective/cover/static/jss.js
src/collective/cover/static/jss.min.js
+src/collective/cover/static/cycle2-theme/jquery.cycle2*.min.js
diff --git a/README.rst b/README.rst
index 69030abb8..1d8b98f01 100644
--- a/README.rst
+++ b/README.rst
@@ -155,6 +155,18 @@ To enable this package in a buildout-based installation:
plone.app.z3cform = 0.6.3
plone.directives.form = 1.1
+#. The carousel slide now defaults to use Cycle2 rather than Galleria, but if
+ you (still) want to use Galleria, then use::
+
+ [buildout]
+ ...
+ eggs =
+ collective.cover[galleria]
+
+ [versions]
+ ...
+ (as above)
+
After updating the configuration you need to run ''bin/buildout'', which will
take care of updating your system.
@@ -162,6 +174,16 @@ Go to the 'Site Setup' page in a Plone site and click on the 'Add-ons' link.
Check the box next to ``collective.cover`` and click the 'Activate' button.
+If you want to use Galleria slides, then load the Generic Setup profile as follows:
+
+#. Go to the ZMI (Zope Management Interface)
+#. Go to portal_setup
+#. Click the Import tab
+#. Select "collective.cover: using deprecated galleria carousel tile" in the
+ drop down field
+#. At the bottom of the page uncheck "Include dependencies", then click "Import
+ all steps"
+
.. Note::
You may have to empty your browser cache and save your resource registries
in order to see the effects of the product installation.
diff --git a/buildout.cfg b/buildout.cfg
index 2f4cd515c..027fa0e12 100644
--- a/buildout.cfg
+++ b/buildout.cfg
@@ -6,7 +6,7 @@ extends =
versions-4.3.x.cfg
package-name = collective.cover
-package-extras = [test]
+package-extras = [test, galleria]
eggs +=
iw.debug
plone.reload
diff --git a/setup.py b/setup.py
index 21cf522f4..1c7bc40aa 100644
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@
'AccessControl',
'Acquisition',
'collective.js.bootstrap',
- 'collective.js.galleria',
+ 'collective.js.cycle2',
'collective.js.jqueryui',
'five.grok',
'Missing',
@@ -96,6 +96,9 @@
'zope.schema',
],
extras_require={
+ 'galleria': [
+ 'collective.js.galleria',
+ ],
'test': [
'mock',
'plone.app.robotframework',
@@ -104,6 +107,7 @@
'plone.cachepurging',
'plone.testing',
'Products.PloneFormGen',
+ 'collective.js.galleria',
],
},
entry_points="""
diff --git a/src/collective/cover/interfaces.py b/src/collective/cover/interfaces.py
index 56d704135..ab7159cc8 100644
--- a/src/collective/cover/interfaces.py
+++ b/src/collective/cover/interfaces.py
@@ -9,6 +9,11 @@ class ICoverLayer(Interface):
"""
+class IGalleriaCarouselsLayer(ICoverLayer):
+ """ A layer indicating that Galleria Carousels are to be used in this add-on.
+ """
+
+
class ICover(form.Schema):
"""A composable page."""
diff --git a/src/collective/cover/profiles.zcml b/src/collective/cover/profiles.zcml
index 185ac84e4..ad254a2ac 100644
--- a/src/collective/cover/profiles.zcml
+++ b/src/collective/cover/profiles.zcml
@@ -2,6 +2,7 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
xmlns:i18n="http://namespaces.zope.org/i18n"
+ xmlns:zcml="http://namespaces.zope.org/zcml"
i18n_domain="collective.cover"
>
@@ -13,6 +14,15 @@
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
+
+
+
+
diff --git a/src/collective/cover/profiles/default/browserlayer.xml b/src/collective/cover/profiles/default/browserlayer.xml
index 0206189d4..15a3f0185 100644
--- a/src/collective/cover/profiles/default/browserlayer.xml
+++ b/src/collective/cover/profiles/default/browserlayer.xml
@@ -2,4 +2,9 @@
+
+
+
diff --git a/src/collective/cover/profiles/default/jsregistry.xml b/src/collective/cover/profiles/default/jsregistry.xml
index 73c6c019e..642a26853 100644
--- a/src/collective/cover/profiles/default/jsregistry.xml
+++ b/src/collective/cover/profiles/default/jsregistry.xml
@@ -9,4 +9,4 @@
-
\ No newline at end of file
+
diff --git a/src/collective/cover/profiles/default/metadata.xml b/src/collective/cover/profiles/default/metadata.xml
index 2cfcc516e..00d53304a 100644
--- a/src/collective/cover/profiles/default/metadata.xml
+++ b/src/collective/cover/profiles/default/metadata.xml
@@ -1,8 +1,8 @@
- 9
+ 10
- profile-collective.js.galleria:default
+ profile-collective.js.cycle2:defaultprofile-collective.js.jqueryui:defaultprofile-plone.app.blocks:defaultprofile-plone.app.dexterity:default
diff --git a/src/collective/cover/profiles/galleriacarousel/browserlayer.xml b/src/collective/cover/profiles/galleriacarousel/browserlayer.xml
new file mode 100644
index 000000000..d91d5d4cb
--- /dev/null
+++ b/src/collective/cover/profiles/galleriacarousel/browserlayer.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/src/collective/cover/profiles/galleriacarousel/jsregistry.xml b/src/collective/cover/profiles/galleriacarousel/jsregistry.xml
new file mode 100644
index 000000000..9d5deed7f
--- /dev/null
+++ b/src/collective/cover/profiles/galleriacarousel/jsregistry.xml
@@ -0,0 +1,8 @@
+
+
diff --git a/src/collective/cover/profiles/galleriacarousel/metadata.xml b/src/collective/cover/profiles/galleriacarousel/metadata.xml
new file mode 100644
index 000000000..35e4a9d3a
--- /dev/null
+++ b/src/collective/cover/profiles/galleriacarousel/metadata.xml
@@ -0,0 +1,8 @@
+
+
+ 1
+
+ profile-collective.cover:default
+ profile-collective.js.galleria:default
+
+
diff --git a/src/collective/cover/profiles/uninstall/browserlayer.xml b/src/collective/cover/profiles/uninstall/browserlayer.xml
new file mode 100644
index 000000000..c07bd7243
--- /dev/null
+++ b/src/collective/cover/profiles/uninstall/browserlayer.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
diff --git a/src/collective/cover/static/cover.css b/src/collective/cover/static/cover.css
index e24e1d7f8..d3e471d87 100644
--- a/src/collective/cover/static/cover.css
+++ b/src/collective/cover/static/cover.css
@@ -19,7 +19,7 @@
background-color:#000;
opacity: 0.6 !important;
display: none;
- z-index: 99;
+ z-index: 120;
}
.loading-mask.show {
display:block;
diff --git a/src/collective/cover/static/cycle2-theme/cycle2.cover_theme.css b/src/collective/cover/static/cycle2-theme/cycle2.cover_theme.css
new file mode 100644
index 000000000..bcdfc4280
--- /dev/null
+++ b/src/collective/cover/static/cycle2-theme/cycle2.cover_theme.css
@@ -0,0 +1,62 @@
+/* Prev/Next arrows */
+.cycle-prev, .cycle-next {
+ cursor: pointer;
+ height: 100%;
+ opacity: 0.7;
+ position: absolute;
+ top: 0;
+ width: 8%;
+ z-index: 110;
+}
+.cycle-prev {
+ background: url("++resource++collective.cover/cycle2-theme/prev-arrow.png") no-repeat scroll 10% 50% rgba(0, 0, 0, 0);
+ left: 0;
+ padding-right: 17%;
+}
+.cycle-next {
+ background: url("++resource++collective.cover/cycle2-theme/next-arrow.png") no-repeat scroll 90% 50% rgba(0, 0, 0, 0);
+ right: 0;
+ padding-left: 17%;
+}
+.cycle-prev:hover, .cycle-next:hover {
+ opacity: 1;
+}
+
+.cycle-pager-container {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ z-index: 110;
+ text-align: center;
+}
+.cycle-pager {
+ display: inline-block;
+ margin: 0 auto;
+ padding: 8px;
+}
+.cycle-pager span {
+ background: url("++resource++collective.cover/cycle2-theme/dot.png") no-repeat;
+ display: inline-block;
+ font-size: 0;
+ height: 16px;
+ opacity: 0.6;
+ width: 16px;
+}
+.cycle-pager > span {
+ cursor: pointer;
+}
+.cycle-pager .cycle-pager-active {
+ opacity: 1;
+}
+.contentActions {
+ z-index: 130;
+}
+
+/* Stop Flash of unstyled content */
+.cycle2-carousel .slide {
+ display: none;
+}
+
+.cycle2-carousel .cycle-pager + .slide {
+ display: block;
+}
diff --git a/src/collective/cover/static/cycle2-theme/dot.png b/src/collective/cover/static/cycle2-theme/dot.png
new file mode 100644
index 000000000..cabf346d9
Binary files /dev/null and b/src/collective/cover/static/cycle2-theme/dot.png differ
diff --git a/src/collective/cover/static/cycle2-theme/next-arrow.png b/src/collective/cover/static/cycle2-theme/next-arrow.png
new file mode 100644
index 000000000..95ac0ce0a
Binary files /dev/null and b/src/collective/cover/static/cycle2-theme/next-arrow.png differ
diff --git a/src/collective/cover/static/cycle2-theme/prev-arrow.png b/src/collective/cover/static/cycle2-theme/prev-arrow.png
new file mode 100644
index 000000000..a5fe44297
Binary files /dev/null and b/src/collective/cover/static/cycle2-theme/prev-arrow.png differ
diff --git a/src/collective/cover/testing.py b/src/collective/cover/testing.py
index a3ba81b80..f1e2f971e 100644
--- a/src/collective/cover/testing.py
+++ b/src/collective/cover/testing.py
@@ -117,7 +117,8 @@ def setUpZope(self, app, configurationContext):
import collective.cover
self.loadZCML(package=collective.cover)
- if 'virtual_hosting' not in app.objectIds():
+ if ('virtual_hosting' not in app.objectIds() and
+ 'VHM' not in app.objectIds()):
# If ZopeLite was imported, we have no default virtual
# host monster
from Products.SiteAccess.VirtualHostMonster \
@@ -160,6 +161,27 @@ def setUpZope(self, app, configurationContext):
sm.registerUtility(newgrid, name='bootstrap3')
+class GalleriaFixture(Fixture):
+
+ defaultBases = (FIXTURE,)
+
+ def setUpZope(self, app, configurationContext):
+
+ # Load ZCML
+ pkg_resources.get_distribution('collective.js.galleria')
+ import collective.js.galleria
+ self.loadZCML(package=collective.js.galleria)
+ z2.installProduct(app, 'collective.js.galleria')
+
+ super(GalleriaFixture, self).setUpZope(app, configurationContext)
+
+ def setUpPloneSite(self, portal):
+
+ super(GalleriaFixture, self).setUpPloneSite(portal)
+ # Install extra Generic Setup profile
+ self.applyProfile(portal, 'collective.cover:galleriacarousel')
+
+
INTEGRATION_TESTING = IntegrationTesting(
bases=(FIXTURE,),
name='collective.cover:Integration',
@@ -179,3 +201,8 @@ def setUpZope(self, app, configurationContext):
ROBOT_TESTING = FunctionalTesting(
bases=(FIXTURE, AUTOLOGIN_LIBRARY_FIXTURE, z2.ZSERVER_FIXTURE),
name='collective.cover:Robot')
+
+GALLERIA_FIXTURE = GalleriaFixture()
+GALLERIA_FUNCTIONAL_TESTING = FunctionalTesting(
+ bases=(GALLERIA_FIXTURE, AUTOLOGIN_LIBRARY_FIXTURE, z2.ZSERVER_FIXTURE),
+ name='collective.cover:GalleriaFunctional')
diff --git a/src/collective/cover/tests/test_carousel_tile.robot b/src/collective/cover/tests/test_carousel_tile.robot
index d7f1b6e29..576befd19 100644
--- a/src/collective/cover/tests/test_carousel_tile.robot
+++ b/src/collective/cover/tests/test_carousel_tile.robot
@@ -10,8 +10,8 @@ Suite Teardown Close all browsers
${carousel_tile_location} "collective.cover.carousel"
${document_selector} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Document"]/span[text()='My document']/..
-${image_selector} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image']/..
-${image_selector2} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image1']/..
+${image_selector1} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image1']/..
+${image_selector2} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image2']/..
${tile_selector} div.tile-container div.tile
${autoplay_id} collective-cover-carousel-autoplay-0
${edit_link_selector} a.edit-tile-link
@@ -21,7 +21,8 @@ ${edit_link_selector} a.edit-tile-link
Get Total Carousel Images
[Documentation] Total number of images in carousel is stored in this
... element
- ${return} = Get Matching XPath Count //div[@class="galleria-stage"]//div[@class="galleria-image"]/img
+ # Note: we are a bit lazy about adding concat here, but then how long do you want this line to be?
+ ${return} = Get Matching XPath Count //div[contains(@class,"cycle2-carousel")]//div[contains(concat(" ", @class," "), " slide ") and not(contains(@class, "sentinel"))]
[Return] ${return}
*** Test cases ***
@@ -45,19 +46,18 @@ Test Carousel Tile
# drag&drop an Image
Open Content Chooser
Click Element link=Content tree
- Drag And Drop xpath=${image_selector} css=${tile_selector}
- # The carousel was previously empty, so autoplay=false, so we might not see the carousel updated
- # Wait Until Page Contains Test image
- # Page Should Contain This image was created for testing purposes
-
- # move to the default view and check tile persisted
- Click Link link=View
- Wait Until Page Contains Test image
- Page Should Contain This image was created for testing purposes
+ Drag And Drop xpath=${image_selector1} css=${tile_selector}
+ Wait Until Page Contains Test image #1
+ Page Should Contain This image #1 was created for testing purposes
# we have 1 image in the carousel
${images} = Get Total Carousel Images
Should Be Equal '${images}' '1'
+ # move to the default view and check tile persisted
+ Click Link link=View
+ Wait Until Page Contains Test image #1
+ Page Should Contain This image #1 was created for testing purposes
+
# drag&drop another Image
Compose Cover
Sleep 1s Wait for carousel to load
@@ -70,8 +70,8 @@ Test Carousel Tile
# move to the default view and check tile persisted
Click Link link=View
Sleep 5s Wait for carousel to load
- Wait Until Page Contains Test image #1
- Page Should Contain This image #1 was created for testing purposes
+ Wait Until Page Contains Test image #2
+ Page Should Contain This image #2 was created for testing purposes
# we now have 2 images in the carousel
${images} = Get Total Carousel Images
Should Be Equal '${images}' '2'
@@ -84,14 +84,13 @@ Test Carousel Tile
Drag And Drop xpath=${document_selector} css=${tile_selector}
- # No point to test Documents - they are not used in carousel
- # see: https://github.com/collective/collective.cover/commit/8df37e04d7299a0cb1a90e9f0a8ace746859c49c
+ # Documents are (at least slightly) revived in Carousel thanks to Cycle2
Click Link link=View
- #Wait Until Page Contains My document
- #Page Should Contain This document was created for testing purposes
+ Wait Until Page Contains My document
+ Page Should Contain This document was created for testing purposes
# carousel autoplay is enabled
- Page Should Contain options.autoplay = true;
+ Page Should Contain Element xpath=//div[contains(@class,"cycle2-carousel") and @data-cycle-paused="false"]
# edit the tile
Compose Cover
@@ -100,12 +99,12 @@ Test Carousel Tile
# disable carousel autoplay
Unselect Checkbox ${autoplay_id}
Click Button Save
- Wait Until Page Contains Test image
- Page Should Contain This image was created for testing purposes
+ Wait Until Page Contains Test image #1
+ Page Should Contain This image #1 was created for testing purposes
# carousel autoplay is now disabled. Sometimes we need to reload the page.
- Compose Cover
- Page Should Contain options.autoplay = false;
+ Reload Page
+ Page Should Contain Element xpath=//div[contains(@class,"cycle2-carousel") and @data-cycle-paused="true"]
# delete the tile
Edit Cover Layout
diff --git a/src/collective/cover/tests/test_galleria_carousel.py b/src/collective/cover/tests/test_galleria_carousel.py
new file mode 100644
index 000000000..fbf8c536a
--- /dev/null
+++ b/src/collective/cover/tests/test_galleria_carousel.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+
+from collective.cover.testing import GALLERIA_FUNCTIONAL_TESTING
+from plone.testing import layered
+
+import os
+import robotsuite
+import unittest
+
+dirname = os.path.dirname(__file__)
+files = os.listdir(dirname)
+tests = ['testgalleria_carousel_tile.robot']
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTests([
+ layered(
+ robotsuite.RobotTestSuite(t, noncritical=['Expected Failure']),
+ layer=GALLERIA_FUNCTIONAL_TESTING)
+ for t in tests
+ ])
+ return suite
diff --git a/src/collective/cover/tests/test_list_tile.robot b/src/collective/cover/tests/test_list_tile.robot
index 6f456b9b1..a182b839d 100644
--- a/src/collective/cover/tests/test_list_tile.robot
+++ b/src/collective/cover/tests/test_list_tile.robot
@@ -11,7 +11,7 @@ Suite Teardown Close all browsers
${list_tile_location} 'collective.cover.list'
${document_selector} .ui-draggable .contenttype-document
${file_selector} .ui-draggable .contenttype-file
-${image_selector} .ui-draggable .contenttype-image
+${image_selector1} //li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image1']/..
${link_selector} .ui-draggable .contenttype-link
${news-item_selector} .ui-draggable .contenttype-news-item
${tile_selector} div.tile-container div.tile
@@ -54,9 +54,9 @@ Test List Tile
Page Should Contain This file was created for testing purposes
# drag&drop an Image
- Drag And Drop css=${image_selector} css=${tile_selector}
- Wait Until Page Contains Test image
- Page Should Contain This image was created for testing purposes
+ Drag And Drop xpath=${image_selector1} css=${tile_selector}
+ Wait Until Page Contains Test image #1
+ Page Should Contain This image #1 was created for testing purposes
# drag&drop a Link
Drag And Drop css=${link_selector} css=${tile_selector}
@@ -73,7 +73,7 @@ Test List Tile
Page Should Not Contain Please add up to 5 objects to the tile.
Page Should Contain My document
Page Should Contain My file
- Page Should Contain Test image
+ Page Should Contain Test image #1
Page Should Contain Test link
Page Should Contain Test news item
diff --git a/src/collective/cover/tests/test_upgrades.py b/src/collective/cover/tests/test_upgrades.py
index 057d23947..0ead0ff0f 100644
--- a/src/collective/cover/tests/test_upgrades.py
+++ b/src/collective/cover/tests/test_upgrades.py
@@ -214,3 +214,29 @@ def test_issue_423(self):
self._do_upgrade_step(step)
permissions = configlet.permissions
self.assertEqual(permissions, ('collective.cover: Setup',))
+
+
+class Upgrade9to10TestCase(UpgradeTestCaseBase):
+
+ def setUp(self):
+ UpgradeTestCaseBase.setUp(self, u'9', u'10')
+
+ def test_upgrade_to_9_registrations(self):
+ version = self.setup.getLastVersionForProfile(self.profile_id)[0]
+ self.assertGreaterEqual(int(version), int(self.to_version))
+ self.assertEqual(self._how_many_upgrades_to_do(), 1)
+
+ def test_install_cycle2(self):
+ cycle2 = 'collective.js.cycle2'
+ title = u'Install collective.js.cycle2'
+ step = self._get_upgrade_step(title)
+ self.assertIsNotNone(step)
+
+ # simulate state on previous version
+ qi = api.portal.get_tool('portal_quickinstaller')
+ qi.uninstallProducts([cycle2])
+ self.assertFalse(qi.isProductInstalled(cycle2))
+
+ # run the upgrade step to validate the update
+ self._do_upgrade_step(step)
+ self.assertTrue(qi.isProductInstalled(cycle2))
diff --git a/src/collective/cover/tests/testgalleria_carousel_tile.robot b/src/collective/cover/tests/testgalleria_carousel_tile.robot
new file mode 100644
index 000000000..2148c946a
--- /dev/null
+++ b/src/collective/cover/tests/testgalleria_carousel_tile.robot
@@ -0,0 +1,112 @@
+*** Settings ***
+
+Resource cover.robot
+Library Remote ${PLONE_URL}/RobotRemote
+
+Suite Setup Open Test Browser
+Suite Teardown Close all browsers
+
+*** Variables ***
+
+${carousel_tile_location} "collective.cover.carousel"
+${document_selector} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Document"]/span[text()='My document']/..
+${image_selector1} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image1']/..
+${image_selector2} //div[@id="content-trees"]//li[@class="ui-draggable"]/a[@data-ct-type="Image"]/span[text()='my-image2']/..
+${tile_selector} div.tile-container div.tile
+${autoplay_id} collective-cover-carousel-autoplay-0
+${edit_link_selector} a.edit-tile-link
+
+*** Keywords ***
+
+Get Total Carousel Images
+ [Documentation] Total number of images in carousel is stored in this
+ ... element
+ ${return} = Get Matching XPath Count //div[@class="galleria-stage"]//div[@class="galleria-image"]/img
+ [Return] ${return}
+
+*** Test cases ***
+
+Test Carousel Tile
+
+ Enable Autologin as Site Administrator
+ Go to Homepage
+ Create Cover Title Description
+
+ # add a carousel tile to the layout
+ Edit Cover Layout
+ Add Tile ${carousel_tile_location}
+ Save Cover Layout
+
+ # as tile is empty, we see default message
+ Compose Cover
+ Page Should Contain This carousel is empty; open the content chooser and drag-and-drop some items here.
+
+ # drag&drop an Image
+ Open Content Chooser
+ Click Element link=Content tree
+ Drag And Drop xpath=${image_selector1} css=${tile_selector}
+ # The carousel was previously empty, so autoplay=false, so we might not see the carousel updated
+ Wait Until Page Contains Test image #1
+ Page Should Contain This image #1 was created for testing purposes
+
+ # move to the default view and check tile persisted
+ Click Link link=View
+ Wait Until Page Contains Test image #1
+ Page Should Contain This image #1 was created for testing purposes
+ # we have 1 image in the carousel
+ ${images} = Get Total Carousel Images
+ Should Be Equal '${images}' '1'
+
+ # drag&drop another Image
+ Compose Cover
+ Sleep 1s Wait for carousel to load
+ Open Content Chooser
+ Click Element link=Content tree
+
+ Drag And Drop xpath=${image_selector2} css=${tile_selector}
+ # Need to change view before second image is loaded
+
+ # move to the default view and check tile persisted
+ Click Link link=View
+ Sleep 5s Wait for carousel to load
+ Wait Until Page Contains Test image #2
+ Page Should Contain This image #2 was created for testing purposes
+ # we now have 2 images in the carousel
+ ${images} = Get Total Carousel Images
+ Should Be Equal '${images}' '2'
+
+ # drag&drop an object without an image: a Page
+ Compose Cover
+ Sleep 1s Wait for carousel to load
+ Open Content Chooser
+ Click Element link=Content tree
+
+ Drag And Drop xpath=${document_selector} css=${tile_selector}
+
+ # No point to test Documents - they are not used in carousel
+ # see: https://github.com/collective/collective.cover/commit/8df37e04d7299a0cb1a90e9f0a8ace746859c49c
+ Click Link link=View
+ #Wait Until Page Contains My document
+ #Page Should Contain This document was created for testing purposes
+
+ # carousel autoplay is enabled
+ Page Should Contain options.autoplay = true;
+
+ # edit the tile
+ Compose Cover
+ Click Link css=${edit_link_selector}
+ Page Should Contain Element css=.textline-sortable-element
+ # disable carousel autoplay
+ Unselect Checkbox ${autoplay_id}
+ Click Button Save
+ Wait Until Page Contains Test image #1
+ Page Should Contain This image #1 was created for testing purposes
+
+ # carousel autoplay is now disabled. Sometimes we need to reload the page.
+ Reload Page
+ Page Should Contain options.autoplay = false;
+
+ # delete the tile
+ Edit Cover Layout
+ Delete Tile
+ Save Cover Layout
diff --git a/src/collective/cover/tiles/carousel.py b/src/collective/cover/tiles/carousel.py
index 14a6c5782..5b34ca264 100644
--- a/src/collective/cover/tiles/carousel.py
+++ b/src/collective/cover/tiles/carousel.py
@@ -27,9 +27,11 @@
class ICarouselTile(IListTile):
- """A carousel based on the Galleria JavaScript image gallery framework.
+ """A carousel based on the Cycle2 plugin (or optionally Galleria)
"""
+ form.omitted('autoplay')
+ form.no_omit(ITileEditForm, 'autoplay')
autoplay = schema.Bool(
title=_(u'Auto play'),
required=False,
@@ -86,6 +88,13 @@ def autoplay(self):
return self.data['autoplay']
+
+class GalleriaCarouselTile(CarouselTile):
+
+ implements(ICarouselTile)
+
+ index = ViewPageTemplateFile('templates/carousel-galleria.pt')
+
def init_js(self):
if self.is_empty():
# Galleria will display scary error messages when it
diff --git a/src/collective/cover/tiles/templates/carousel-galleria.pt b/src/collective/cover/tiles/templates/carousel-galleria.pt
new file mode 100644
index 000000000..804f9b6f6
--- /dev/null
+++ b/src/collective/cover/tiles/templates/carousel-galleria.pt
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+ This carousel is empty; open the content chooser and drag-and-drop some items here.
+
+
+
+
+
+
+
+
+
diff --git a/src/collective/cover/tiles/templates/carousel.pt b/src/collective/cover/tiles/templates/carousel.pt
index 804f9b6f6..539c8cda7 100644
--- a/src/collective/cover/tiles/templates/carousel.pt
+++ b/src/collective/cover/tiles/templates/carousel.pt
@@ -6,9 +6,8 @@
-
+ tal:attributes="href string:${context/@@plone_portal_state/portal_url}/++resource++collective.cover/cycle2-theme/cycle2.cover_theme.css" />
+
@@ -17,20 +16,57 @@
This carousel is empty; open the content chooser and drag-and-drop some items here.