src/pyams_content/component/paragraph/interfaces/html.py
changeset 1141 a033c4cad074
parent 586 28445044f6e3
child 1243 837612af4dc3
equal deleted inserted replaced
1140:1df391914ba5 1141:a033c4cad074
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
    12 
    12 
    13 __docformat__ = 'restructuredtext'
    13 __docformat__ = 'restructuredtext'
    14 
    14 
       
    15 from zope.schema import Choice
    15 
    16 
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 from pyams_content.component.paragraph.interfaces import IBaseParagraph
    17 from pyams_content.component.paragraph.interfaces import IBaseParagraph
    20 
       
    21 # import packages
       
    22 from pyams_i18n.schema import I18nHTMLField, I18nTextField
    18 from pyams_i18n.schema import I18nHTMLField, I18nTextField
    23 from zope.schema import Choice
       
    24 
    19 
    25 from pyams_content import _
    20 from pyams_content import _
    26 
    21 
    27 
    22 
    28 #
    23 #
    29 # Raw HTML paragraph
    24 # Raw HTML paragraph
    30 #
    25 #
    31 
    26 
    32 RAW_PARAGRAPH_TYPE = 'raw'
    27 RAW_PARAGRAPH_TYPE = 'raw'
    33 RAW_PARAGRAPH_NAME = _("Raw HTML ")
    28 RAW_PARAGRAPH_NAME = _("Raw source")
    34 RAW_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.raw.renderers'
    29 RAW_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.raw.renderers'
    35 
    30 
    36 
    31 
    37 class IRawParagraph(IBaseParagraph):
    32 class IRawParagraph(IBaseParagraph):
    38     """Raw HTML paragraph interface"""
    33     """Raw HTML paragraph interface"""
    39 
    34 
    40     body = I18nTextField(title=_("Raw HTML code"),
    35     body = I18nTextField(title=_("Source code"),
    41                          description=_("This HTML code will be used 'as is', without any transformation. Use with "
    36                          description=_("This code will be used 'as is', without any transformation, if using the "
    42                                        "care!!"),
    37                                        "'raw' renderer. Use with care!!"),
    43                          required=False)
    38                          required=False)
    44 
    39 
    45     renderer = Choice(title=_("Raw HTML code template"),
    40     renderer = Choice(title=_("Source code template"),
    46                       description=_("Presentation template used for this paragraph"),
    41                       description=_("Presentation template used for this paragraph"),
    47                       vocabulary=RAW_PARAGRAPH_RENDERERS,
    42                       vocabulary=RAW_PARAGRAPH_RENDERERS,
    48                       default='default')
    43                       default='default')
    49 
    44 
    50 
    45