src/pyams_content/component/paragraph/frame.py
changeset 586 28445044f6e3
parent 555 8e8a14452567
child 923 b57388b3beb3
equal deleted inserted replaced
585:9fa8e9776bda 586:28445044f6e3
    19 from pyams_content.component.extfile.interfaces import IExtFileContainerTarget
    19 from pyams_content.component.extfile.interfaces import IExtFileContainerTarget
    20 from pyams_content.component.illustration.interfaces import IIllustrationTarget
    20 from pyams_content.component.illustration.interfaces import IIllustrationTarget
    21 from pyams_content.component.links.interfaces import ILinkContainerTarget
    21 from pyams_content.component.links.interfaces import ILinkContainerTarget
    22 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    22 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    23 from pyams_content.component.paragraph.interfaces.frame import IFrameParagraph, FRAME_PARAGRAPH_TYPE, \
    23 from pyams_content.component.paragraph.interfaces.frame import IFrameParagraph, FRAME_PARAGRAPH_TYPE, \
    24     FRAME_PARAGRAPH_RENDERERS
    24     FRAME_PARAGRAPH_RENDERERS, FRAME_PARAGRAPH_NAME
    25 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
    25 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
    26 from pyams_i18n.interfaces import II18n, II18nManager, INegotiator
    26 from pyams_i18n.interfaces import II18n, II18nManager, INegotiator
    27 
    27 
    28 # import packages
    28 # import packages
    29 from pyams_content.component.paragraph import BaseParagraph, BaseParagraphContentChecker, BaseParagraphFactory
    29 from pyams_content.component.paragraph import BaseParagraph, BaseParagraphContentChecker, BaseParagraphFactory
    34 from pyams_utils.traversing import get_parent
    34 from pyams_utils.traversing import get_parent
    35 from pyams_utils.vocabulary import vocabulary_config
    35 from pyams_utils.vocabulary import vocabulary_config
    36 from zope.interface import implementer
    36 from zope.interface import implementer
    37 from zope.schema.fieldproperty import FieldProperty
    37 from zope.schema.fieldproperty import FieldProperty
    38 
    38 
    39 from pyams_content import _
       
    40 
       
    41 
    39 
    42 #
    40 #
    43 # Frame paragraph
    41 # Frame paragraph
    44 #
    42 #
    45 
    43 
    47 @factory_config(provided=IFrameParagraph)
    45 @factory_config(provided=IFrameParagraph)
    48 class FrameParagraph(BaseParagraph):
    46 class FrameParagraph(BaseParagraph):
    49     """Framed text paragraph"""
    47     """Framed text paragraph"""
    50 
    48 
    51     icon_class = 'fa-list-alt'
    49     icon_class = 'fa-list-alt'
    52     icon_hint = _("Framed text")
    50     icon_hint = FRAME_PARAGRAPH_NAME
    53 
    51 
    54     body = FieldProperty(IFrameParagraph['body'])
    52     body = FieldProperty(IFrameParagraph['body'])
    55     renderer = FieldProperty(IFrameParagraph['renderer'])
    53     renderer = FieldProperty(IFrameParagraph['renderer'])
    56 
    54 
    57 
    55 
    58 @utility_config(name=FRAME_PARAGRAPH_TYPE, provides=IParagraphFactory)
    56 @utility_config(name=FRAME_PARAGRAPH_TYPE, provides=IParagraphFactory)
    59 class FrameParagraphFactory(BaseParagraphFactory):
    57 class FrameParagraphFactory(BaseParagraphFactory):
    60     """Framed text paragraph factory"""
    58     """Framed text paragraph factory"""
    61 
    59 
    62     name = _("Framed text paragraph")
    60     name = FRAME_PARAGRAPH_NAME
    63     content_type = FrameParagraph
    61     content_type = FrameParagraph
    64     secondary_menu = True
    62     secondary_menu = True
    65 
    63 
    66 
    64 
    67 @adapter_config(context=IFrameParagraph, provides=IContentChecker)
    65 @adapter_config(context=IFrameParagraph, provides=IContentChecker)