src/pyams_content/component/paragraph/portlet/interfaces/__init__.py
changeset 930 814f7c5e04d1
child 948 6d3438907215
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/component/paragraph/portlet/interfaces/__init__.py	Thu Sep 06 17:43:49 2018 +0200
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2008-2018 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import packages
+from zope.schema import Bool, Set, Choice, List
+
+from pyams_content import _
+# import interfaces
+from pyams_content.component.paragraph.interfaces import PARAGRAPH_FACTORIES_VOCABULARY
+from pyams_portal.interfaces import IPortletSettings
+
+
+class IParagraphContainerPortletSettings(IPortletSettings):
+    """Paragraphs container portlet settings interface"""
+
+    paragraphs = List(title=_("Selected paragraphs"),
+                      description=_("List of selected paragraphs; an empty selection means that "
+                                    "all paragraphs will be selectable by following filters; otherwise, "
+                                    "this selection will have priority"),
+                      value_type=Choice(vocabulary='PyAMS content paragraphs'),
+                      required=False)
+
+    factories = Set(title=_("Paragraph types"),
+                    description=_("Select list of paragraph types you want to include; an empty "
+                                  "selection means that all paragraphs types will be selected"),
+                    required=False,
+                    value_type=Choice(vocabulary=PARAGRAPH_FACTORIES_VOCABULARY))
+
+    anchors_only = Bool(title=_("Anchors only?"),
+                        description=_("If 'yes', only paragraphs set as 'anchors' will be selected"),
+                        required=True,
+                        default=False)