diff -r 3b5cf400af18 -r 9a6afbc6ab4f src/pyams_content/component/paragraph/interfaces/verbatim.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/paragraph/interfaces/verbatim.py Wed Mar 07 14:46:15 2018 +0100 @@ -0,0 +1,55 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# 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 I18nTextLineField, I18nTextField +from zope.schema import Choice, TextLine + +from pyams_content import _ + + +# +# Verbatim paragraph +# + +VERBATIM_PARAGRAPH_TYPE = 'Verbatim' +VERBATIM_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.verbatim.renderers' + + +class IVerbatimParagraph(IRenderedContent, IBaseParagraph): + """Verbatim paragraph interface""" + + quote = I18nTextField(title=_("Quoted text"), + description=_("Quotation marks will be added automatically by presentation template"), + required=True) + + author = TextLine(title=_("Author"), + description=_("Name of the quote author"), + required=False) + + charge = I18nTextLineField(title=_("In charge of"), + description=_("Label of author function"), + required=False) + + renderer = Choice(title=_("Verbatim template"), + description=_("Presentation template used for this paragraph"), + vocabulary=VERBATIM_PARAGRAPH_RENDERERS, + default='default')