Added label to portlet renderers
authorThierry Florac <thierry.florac@onf.fr>
Wed, 28 Jun 2017 10:16:27 +0200
changeset 33 24c6db8d13f1
parent 32 f9daa4fe49ce
child 34 0a7a5155d352
Added label to portlet renderers
src/pyams_portal/portlets/content/__init__.py
src/pyams_portal/portlets/content/content.pt
src/pyams_portal/portlets/image/__init__.py
src/pyams_portal/portlets/image/interfaces.py
--- a/src/pyams_portal/portlets/content/__init__.py	Wed Jun 28 10:15:38 2017 +0200
+++ b/src/pyams_portal/portlets/content/__init__.py	Wed Jun 28 10:16:27 2017 +0200
@@ -52,3 +52,5 @@
 @template_config(template='content.pt', layer=IPyAMSLayer)
 class ContentPortletRenderer(PortletRenderer):
     """Content portlet renderer"""
+
+    label = _("Default content renderer")
--- a/src/pyams_portal/portlets/content/content.pt	Wed Jun 28 10:15:38 2017 +0200
+++ b/src/pyams_portal/portlets/content/content.pt	Wed Jun 28 10:16:27 2017 +0200
@@ -1,1 +1,1 @@
-<h3>This is my context!!!</h3>
+<h3>This is my context !!!</h3>
--- a/src/pyams_portal/portlets/image/__init__.py	Wed Jun 28 10:15:38 2017 +0200
+++ b/src/pyams_portal/portlets/image/__init__.py	Wed Jun 28 10:16:27 2017 +0200
@@ -70,9 +70,4 @@
 class ImagePortletRenderer(PortletRenderer):
     """Image portlet renderer"""
 
-    @property
-    def slot_configuration(self):
-        template = IPortalPage(self.context).template
-        config = IPortalTemplateConfiguration(template)
-        slot_id, slot_name = config.get_portlet_slot(self.settings.configuration.portlet_id)
-        return config.get_slot_configuration(slot_name)
+    label = _("Responsive image renderer")
--- a/src/pyams_portal/portlets/image/interfaces.py	Wed Jun 28 10:15:38 2017 +0200
+++ b/src/pyams_portal/portlets/image/interfaces.py	Wed Jun 28 10:16:27 2017 +0200
@@ -16,10 +16,10 @@
 # import standard library
 
 # import interfaces
-from pyams_file.schema import ImageField
 from pyams_portal.interfaces import IPortletSettings
 
 # import packages
+from pyams_file.schema import ImageField
 
 from pyams_portal import _