Renamed "settings_class" portlet attribute to "settings_factory"
authorThierry Florac <thierry.florac@onf.fr>
Fri, 15 Jun 2018 14:08:58 +0200
changeset 691 773429b4a3ed
parent 690 1e227243eea2
child 692 58f3c1b9bcfc
Renamed "settings_class" portlet attribute to "settings_factory"
src/pyams_content/features/menu/portlet/navigation/double.py
src/pyams_content/features/menu/portlet/navigation/simple.py
src/pyams_content/shared/common/portlet/content/__init__.py
src/pyams_content/shared/view/portlet/__init__.py
--- a/src/pyams_content/features/menu/portlet/navigation/double.py	Fri Jun 15 11:05:24 2018 +0200
+++ b/src/pyams_content/features/menu/portlet/navigation/double.py	Fri Jun 15 14:08:58 2018 +0200
@@ -28,6 +28,7 @@
 from pyams_content.features.menu import MenusContainer
 from pyams_portal.portlet import PortletSettings, portlet_config, Portlet
 from pyams_utils.adapter import get_annotation_adapter, adapter_config
+from pyams_utils.factory import factory_config
 from pyramid.events import subscriber
 from zope.interface import implementer, alsoProvides
 from zope.schema.fieldproperty import FieldProperty
@@ -40,6 +41,7 @@
 
 
 @implementer(IDoubleNavigationPortletSettings, IMenusContainerTarget)
+@factory_config(provided=IDoubleNavigationPortletSettings)
 class DoubleNavigationPortletSettings(PortletSettings):
     """Double navigation portlet settings"""
 
@@ -65,7 +67,9 @@
     name = DOUBLE_NAVIGATION_PORTLET_NAME
     label = _("Double navigation")
 
-    settings_class = DoubleNavigationPortletSettings
+    toolbar_css_class = 'fa fa-fw fa-2x fa-list-alt'
+
+    settings_factory = IDoubleNavigationPortletSettings
 
 
 @subscriber(IObjectAddedEvent, parent_selector=IDoubleNavigationMenusContainer)
--- a/src/pyams_content/features/menu/portlet/navigation/simple.py	Fri Jun 15 11:05:24 2018 +0200
+++ b/src/pyams_content/features/menu/portlet/navigation/simple.py	Fri Jun 15 14:08:58 2018 +0200
@@ -28,6 +28,7 @@
 from pyams_content.features.menu import Menu
 from pyams_portal.portlet import PortletSettings, portlet_config, Portlet
 from pyams_utils.adapter import get_annotation_adapter, adapter_config
+from pyams_utils.factory import factory_config
 from pyramid.events import subscriber
 from zope.interface import implementer, alsoProvides
 from zope.schema.fieldproperty import FieldProperty
@@ -40,6 +41,7 @@
 
 
 @implementer(ISimpleNavigationPortletSettings, IMenuLinksContainerTarget)
+@factory_config(provided=ISimpleNavigationPortletSettings)
 class SimpleNavigationPortletSettings(PortletSettings):
     """Simple navigation portlet settings"""
 
@@ -65,7 +67,9 @@
     name = SIMPLE_NAVIGATION_PORTLET_NAME
     label = _("Simple navigation")
 
-    settings_class = SimpleNavigationPortletSettings
+    toolbar_css_class = 'fa fa-fw fa-2x fa-bars'
+
+    settings_factory = ISimpleNavigationPortletSettings
 
 
 @subscriber(IObjectAddedEvent, parent_selector=ISimpleNavigationMenu)
--- a/src/pyams_content/shared/common/portlet/content/__init__.py	Fri Jun 15 11:05:24 2018 +0200
+++ b/src/pyams_content/shared/common/portlet/content/__init__.py	Fri Jun 15 14:08:58 2018 +0200
@@ -21,6 +21,7 @@
 
 # import packages
 from pyams_portal.portlet import PortletSettings, portlet_config, Portlet
+from pyams_utils.factory import factory_config
 from zope.interface import implementer
 
 from pyams_content import _
@@ -30,6 +31,7 @@
 
 
 @implementer(ISharedContentPortletSettings)
+@factory_config(provided=ISharedContentPortletSettings)
 class SharedContentPortletSettings(PortletSettings):
     """Shared content portlet persistent settings"""
 
@@ -41,4 +43,4 @@
     name = SHARED_CONTENT_PORTLET_NAME
     label = _("Context content")
 
-    settings_class = SharedContentPortletSettings
+    settings_factory = ISharedContentPortletSettings
--- a/src/pyams_content/shared/view/portlet/__init__.py	Fri Jun 15 11:05:24 2018 +0200
+++ b/src/pyams_content/shared/view/portlet/__init__.py	Fri Jun 15 14:08:58 2018 +0200
@@ -23,6 +23,7 @@
 from pyams_content.workflow import PUBLISHED_STATES
 from pyams_portal.portlet import PortletSettings, portlet_config, Portlet
 from pyams_sequence.utility import get_sequence_target
+from pyams_utils.factory import factory_config
 from zope.interface import implementer
 from zope.schema.fieldproperty import FieldProperty
 
@@ -33,6 +34,7 @@
 
 
 @implementer(IViewItemsPortletSettings)
+@factory_config(provided=IViewItemsPortletSettings)
 class ViewItemsPortletSettings(PortletSettings):
     """View items portlet settings"""
 
@@ -58,4 +60,4 @@
     toolbar_image = None
     toolbar_css_class = 'fa fa-fw fa-2x fa-th-list'
 
-    settings_class = ViewItemsPortletSettings
+    settings_factory = IViewItemsPortletSettings