src/pyams_content/shared/logo/paragraph.py
changeset 586 28445044f6e3
parent 555 8e8a14452567
child 841 d50743e69693
equal deleted inserted replaced
585:9fa8e9776bda 586:28445044f6e3
    16 # import standard library
    16 # import standard library
    17 
    17 
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE, ERROR_VALUE
    19 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE, ERROR_VALUE
    20 from pyams_content.features.renderer.interfaces import IContentRenderer
    20 from pyams_content.features.renderer.interfaces import IContentRenderer
    21 from pyams_content.shared.logo.interfaces import ILogosParagraph, LOGOS_PARAGRAPH_TYPE, LOGOS_PARAGRAPH_RENDERERS
    21 from pyams_content.shared.logo.interfaces import ILogosParagraph, LOGOS_PARAGRAPH_TYPE, LOGOS_PARAGRAPH_RENDERERS, \
       
    22     LOGOS_PARAGRAPH_NAME
    22 from pyams_i18n.interfaces import II18nManager, INegotiator, II18n
    23 from pyams_i18n.interfaces import II18nManager, INegotiator, II18n
    23 from pyams_workflow.interfaces import IWorkflow, IWorkflowState
    24 from pyams_workflow.interfaces import IWorkflow, IWorkflowState
    24 
    25 
    25 # import packages
    26 # import packages
    26 from pyams_content.component.paragraph import BaseParagraph, IParagraphFactory, BaseParagraphFactory, \
    27 from pyams_content.component.paragraph import BaseParagraph, IParagraphFactory, BaseParagraphFactory, \
    41 @implementer(ILogosParagraph)
    42 @implementer(ILogosParagraph)
    42 class LogosParagraph(BaseParagraph):
    43 class LogosParagraph(BaseParagraph):
    43     """Logos paragraph"""
    44     """Logos paragraph"""
    44 
    45 
    45     icon_class = 'fa-th-large'
    46     icon_class = 'fa-th-large'
    46     icon_hint = _("Logos")
    47     icon_hint = LOGOS_PARAGRAPH_NAME
    47 
    48 
    48     references = FieldProperty(ILogosParagraph['references'])
    49     references = FieldProperty(ILogosParagraph['references'])
    49     renderer = FieldProperty(ILogosParagraph['renderer'])
    50     renderer = FieldProperty(ILogosParagraph['renderer'])
    50 
    51 
    51     def get_targets(self, state=None, with_reference=False):
    52     def get_targets(self, state=None, with_reference=False):
    58 
    59 
    59 @utility_config(name=LOGOS_PARAGRAPH_TYPE, provides=IParagraphFactory)
    60 @utility_config(name=LOGOS_PARAGRAPH_TYPE, provides=IParagraphFactory)
    60 class LogosParagraphFactory(BaseParagraphFactory):
    61 class LogosParagraphFactory(BaseParagraphFactory):
    61     """Logos paragraph factory"""
    62     """Logos paragraph factory"""
    62 
    63 
    63     name = _("Logos")
    64     name = LOGOS_PARAGRAPH_NAME
    64     content_type = LogosParagraph
    65     content_type = LogosParagraph
    65     secondary_menu = True
    66     secondary_menu = True
    66 
    67 
    67 
    68 
    68 @adapter_config(context=ILogosParagraph, provides=IContentChecker)
    69 @adapter_config(context=ILogosParagraph, provides=IContentChecker)