--- a/src/pyams_portal/portlets/image/__init__.py Thu Oct 08 12:26:42 2015 +0200
+++ b/src/pyams_portal/portlets/image/__init__.py Mon Jan 18 18:09:46 2016 +0100
@@ -16,14 +16,14 @@
# import standard library
# import interfaces
-from .interfaces import IImagePortletConfiguration
+from .interfaces import IImagePortletSettings
from pyams_portal.interfaces import IPortalContext, IPortletRenderer
from pyams_skin.layer import IPyAMSLayer
from pyams_utils.interfaces import VIEW_PERMISSION
# import packages
from pyams_file.property import FileProperty
-from pyams_portal.portlet import portlet_config, Portlet, PortletConfiguration, PortletRenderer
+from pyams_portal.portlet import portlet_config, Portlet, PortletSettings, PortletRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
from zope.interface import implementer, Interface
@@ -34,12 +34,16 @@
IMAGE_PORTLET_NAME = 'pyams_portal.portlet.image'
+@implementer(IImagePortletSettings)
+class ImagePortletSettings(PortletSettings):
+ """Image portlet settings"""
+
+ image = FileProperty(IImagePortletSettings['image'])
+
+
@portlet_config(permission=VIEW_PERMISSION)
class ImagePortlet(Portlet):
- """Image portlet
-
- The goal of this portlet is to display an image
- """
+ """Image portlet"""
name = IMAGE_PORTLET_NAME
label = _("Image")
@@ -47,13 +51,7 @@
toolbar_image = None
toolbar_css_class = 'fa fa-fw fa-2x fa-picture-o'
-
-@adapter_config(context=ImagePortlet, provides=IImagePortletConfiguration)
-@implementer(IImagePortletConfiguration)
-class ImagePortletConfiguration(PortletConfiguration):
- """Image portlet configuration"""
-
- image = FileProperty(IImagePortletConfiguration['image'])
+ settings_class = ImagePortletSettings
@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ImagePortlet), provides=IPortletRenderer)