|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 |
|
16 # import standard library |
|
17 |
|
18 # import interfaces |
|
19 from pyams_content.component.paragraph.interfaces import IBaseParagraph |
|
20 from pyams_content.features.renderer import IRenderedContent |
|
21 |
|
22 # import packages |
|
23 from pyams_i18n.schema import I18nTextLineField, I18nTextField |
|
24 from zope.schema import Choice, TextLine |
|
25 |
|
26 from pyams_content import _ |
|
27 |
|
28 |
|
29 # |
|
30 # Verbatim paragraph |
|
31 # |
|
32 |
|
33 VERBATIM_PARAGRAPH_TYPE = 'Verbatim' |
|
34 VERBATIM_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.verbatim.renderers' |
|
35 |
|
36 |
|
37 class IVerbatimParagraph(IRenderedContent, IBaseParagraph): |
|
38 """Verbatim paragraph interface""" |
|
39 |
|
40 quote = I18nTextField(title=_("Quoted text"), |
|
41 description=_("Quotation marks will be added automatically by presentation template"), |
|
42 required=True) |
|
43 |
|
44 author = TextLine(title=_("Author"), |
|
45 description=_("Name of the quote author"), |
|
46 required=False) |
|
47 |
|
48 charge = I18nTextLineField(title=_("In charge of"), |
|
49 description=_("Label of author function"), |
|
50 required=False) |
|
51 |
|
52 renderer = Choice(title=_("Verbatim template"), |
|
53 description=_("Presentation template used for this paragraph"), |
|
54 vocabulary=VERBATIM_PARAGRAPH_RENDERERS, |
|
55 default='default') |