src/pyams_content/component/paragraph/interfaces/video.py
changeset 439 2a61d39de0fc
parent 407 0ef5de2d5674
child 555 8e8a14452567
equal deleted inserted replaced
438:117089568313 439:2a61d39de0fc
    15 
    15 
    16 # import standard library
    16 # import standard library
    17 
    17 
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.component.paragraph.interfaces import IBaseParagraph
    19 from pyams_content.component.paragraph.interfaces import IBaseParagraph
       
    20 from pyams_content.features.renderer.interfaces import IRenderedContent
    20 
    21 
    21 # import packages
    22 # import packages
    22 from pyams_file.schema import VideoField
    23 from pyams_file.schema import VideoField
    23 from pyams_i18n.schema import I18nHTMLField, I18nTextField
    24 from pyams_i18n.schema import I18nHTMLField, I18nTextField
    24 from zope.schema import TextLine
    25 from zope.schema import TextLine, Choice
    25 
    26 
    26 from pyams_content import _
    27 from pyams_content import _
    27 
    28 
    28 
    29 
    29 #
    30 #
    30 # HTML paragraph
    31 # HTML paragraph
    31 #
    32 #
    32 
    33 
    33 VIDEO_PARAGRAPH_TYPE = 'Video'
    34 VIDEO_PARAGRAPH_TYPE = 'Video'
       
    35 VIDEO_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.video.renderers'
    34 
    36 
    35 
    37 
    36 class IVideoParagraph(IBaseParagraph):
    38 class IVideoParagraph(IRenderedContent, IBaseParagraph):
    37     """Video paragraph"""
    39     """Video paragraph"""
    38 
    40 
    39     body = I18nHTMLField(title=_("Body"),
    41     body = I18nHTMLField(title=_("Body"),
    40                          required=False)
    42                          required=False)
    41 
    43 
    48                       required=False)
    50                       required=False)
    49 
    51 
    50     data = VideoField(title=_("Video data"),
    52     data = VideoField(title=_("Video data"),
    51                       description=_("Video file content"),
    53                       description=_("Video file content"),
    52                       required=True)
    54                       required=True)
       
    55 
       
    56     renderer = Choice(title=_("Video template"),
       
    57                       description=_("Presentation template used for this video"),
       
    58                       vocabulary=VIDEO_PARAGRAPH_RENDERERS,
       
    59                       default='default')