src/pyams_content/component/paragraph/interfaces/text.py
changeset 443 326adf3362d8
parent 407 0ef5de2d5674
equal deleted inserted replaced
442:5dc8421cbcfc 443:326adf3362d8
       
     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 I18nHTMLField
       
    24 from zope.schema import Choice
       
    25 
       
    26 from pyams_content import _
       
    27 
       
    28 
       
    29 #
       
    30 # Text paragraph
       
    31 #
       
    32 
       
    33 TEXT_PARAGRAPH_TYPE = 'Text'
       
    34 TEXT_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.text.renderers'
       
    35 
       
    36 
       
    37 class ITextParagraph(IRenderedContent, IBaseParagraph):
       
    38     """Simple text paragraph interface"""
       
    39 
       
    40     body = I18nHTMLField(title=_("Frame body"),
       
    41                          required=False)
       
    42 
       
    43     renderer = Choice(title=_("Text template"),
       
    44                       description=_("Presentation template used for this paragraph"),
       
    45                       vocabulary=TEXT_PARAGRAPH_RENDERERS,
       
    46                       default='default')