src/pyams_content/component/paragraph/interfaces/text.py
changeset 443 326adf3362d8
parent 407 0ef5de2d5674
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/component/paragraph/interfaces/text.py	Tue Mar 06 15:04:55 2018 +0100
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2008-2015 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 interfaces
+from pyams_content.component.paragraph.interfaces import IBaseParagraph
+from pyams_content.features.renderer import IRenderedContent
+
+# import packages
+from pyams_i18n.schema import I18nHTMLField
+from zope.schema import Choice
+
+from pyams_content import _
+
+
+#
+# Text paragraph
+#
+
+TEXT_PARAGRAPH_TYPE = 'Text'
+TEXT_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.text.renderers'
+
+
+class ITextParagraph(IRenderedContent, IBaseParagraph):
+    """Simple text paragraph interface"""
+
+    body = I18nHTMLField(title=_("Frame body"),
+                         required=False)
+
+    renderer = Choice(title=_("Text template"),
+                      description=_("Presentation template used for this paragraph"),
+                      vocabulary=TEXT_PARAGRAPH_RENDERERS,
+                      default='default')