Added title to view content portlet
authorThierry Florac <thierry.florac@onf.fr>
Tue, 10 Jul 2018 12:40:16 +0200
changeset 821 967b4099c82e
parent 820 ef6e71a98a5a
child 822 5ac0fcedd89e
Added title to view content portlet
src/pyams_content/shared/view/portlet/__init__.py
src/pyams_content/shared/view/portlet/interfaces.py
--- a/src/pyams_content/shared/view/portlet/__init__.py	Tue Jul 10 12:39:56 2018 +0200
+++ b/src/pyams_content/shared/view/portlet/__init__.py	Tue Jul 10 12:40:16 2018 +0200
@@ -44,6 +44,7 @@
 class ViewItemsPortletSettings(PortletSettings):
     """View items portlet settings"""
 
+    title = FieldProperty(IViewItemsPortletSettings['title'])
     views = FieldProperty(IViewItemsPortletSettings['views'])
     views_context = FieldProperty(IViewItemsPortletSettings['views_context'])
     views_merge_mode = FieldProperty(IViewItemsPortletSettings['views_merge_mode'])
--- a/src/pyams_content/shared/view/portlet/interfaces.py	Tue Jul 10 12:39:56 2018 +0200
+++ b/src/pyams_content/shared/view/portlet/interfaces.py	Tue Jul 10 12:40:16 2018 +0200
@@ -22,6 +22,7 @@
 # import packages
 from pyams_content.shared.view import WfView
 from pyams_content.shared.view.merge import CONCAT_VIEWS_MERGE_MODE
+from pyams_i18n.schema import I18nTextLineField
 from pyams_sequence.schema import InternalReferencesList
 from zope.schema import Choice, Int
 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
@@ -52,6 +53,9 @@
 class IViewItemsPortletSettings(IPortletSettings):
     """View items portlet settings interface"""
 
+    title = I18nTextLineField(title=_("Title"),
+                              required=False)
+
     views = InternalReferencesList(title=_("Selected views"),
                                    description=_("Reference to the view(s) from which items are extracted; "
                                                  "you can combine several views together and specify in which order "