src/pyams_content/component/illustration/paragraph.py
changeset 586 28445044f6e3
parent 407 0ef5de2d5674
child 1243 837612af4dc3
equal deleted inserted replaced
585:9fa8e9776bda 586:28445044f6e3
    14 
    14 
    15 
    15 
    16 # import standard library
    16 # import standard library
    17 
    17 
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.component.illustration.interfaces import IIllustrationParagraph, ILLUSTRATION_PARAGRAPH_TYPE
    19 from pyams_content.component.illustration.interfaces import IIllustrationParagraph, ILLUSTRATION_PARAGRAPH_TYPE, \
       
    20     ILLUSTRATION_PARAGRAPH_NAME
    20 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    21 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    21 from pyams_content.features.checker.interfaces import IContentChecker
    22 from pyams_content.features.checker.interfaces import IContentChecker
    22 from pyams_i18n.interfaces import II18n
    23 from pyams_i18n.interfaces import II18n
    23 
    24 
    24 # import packages
    25 # import packages
    27 from pyams_utils.adapter import adapter_config
    28 from pyams_utils.adapter import adapter_config
    28 from pyams_utils.registry import utility_config
    29 from pyams_utils.registry import utility_config
    29 from pyams_utils.request import check_request
    30 from pyams_utils.request import check_request
    30 from zope.interface import implementer
    31 from zope.interface import implementer
    31 
    32 
    32 from pyams_content import _
       
    33 
       
    34 
    33 
    35 @implementer(IIllustrationParagraph)
    34 @implementer(IIllustrationParagraph)
    36 class Illustration(BaseIllustration, BaseParagraph):
    35 class Illustration(BaseIllustration, BaseParagraph):
    37     """Illustration class"""
    36     """Illustration class"""
    38 
    37 
    39     icon_class = 'fa-file-image-o'
    38     icon_class = 'fa-file-image-o'
    40     icon_hint = _("Illustration")
    39     icon_hint = ILLUSTRATION_PARAGRAPH_NAME
    41 
    40 
    42 
    41 
    43 @utility_config(name=ILLUSTRATION_PARAGRAPH_TYPE, provides=IParagraphFactory)
    42 @utility_config(name=ILLUSTRATION_PARAGRAPH_TYPE, provides=IParagraphFactory)
    44 class IllustrationFactory(BaseParagraphFactory):
    43 class IllustrationFactory(BaseParagraphFactory):
    45     """Illustration paragraph factory"""
    44     """Illustration paragraph factory"""
    46 
    45 
    47     name = _("Illustration")
    46     name = ILLUSTRATION_PARAGRAPH_NAME
    48     content_type = Illustration
    47     content_type = Illustration
    49 
    48 
    50 
    49 
    51 @adapter_config(context=IIllustrationParagraph, provides=IContentChecker)
    50 @adapter_config(context=IIllustrationParagraph, provides=IContentChecker)
    52 class IllustrationParagraphContentChecker(IllustrationContentChecker):
    51 class IllustrationParagraphContentChecker(IllustrationContentChecker):