src/pyams_default_theme/component/paragraph/contact.py
changeset 380 f549a5cd4781
parent 240 00334308efd4
child 390 f2c646b0ddbf
equal deleted inserted replaced
379:240417d006df 380:f549a5cd4781
    11 #
    11 #
    12 
    12 
    13 __docformat__ = 'restructuredtext'
    13 __docformat__ = 'restructuredtext'
    14 
    14 
    15 from persistent import Persistent
    15 from persistent import Persistent
    16 from zope.interface import implementer
       
    17 from zope.location import Location
    16 from zope.location import Location
    18 from zope.schema.fieldproperty import FieldProperty
    17 from zope.schema.fieldproperty import FieldProperty
    19 
    18 
    20 from pyams_content.component.paragraph.interfaces.contact import IContactParagraph, have_gis
    19 from pyams_content.component.paragraph.interfaces.contact import IContactParagraph, have_gis
    21 from pyams_content.features.renderer.interfaces import IContentRenderer
    20 from pyams_content.features.renderer.interfaces import IContentRenderer
    23 from pyams_default_theme.features.renderer import BaseContentRenderer
    22 from pyams_default_theme.features.renderer import BaseContentRenderer
    24 from pyams_i18n.interfaces import II18n
    23 from pyams_i18n.interfaces import II18n
    25 from pyams_skin.layer import IPyAMSLayer
    24 from pyams_skin.layer import IPyAMSLayer
    26 from pyams_template.template import template_config
    25 from pyams_template.template import template_config
    27 from pyams_utils.adapter import adapter_config, get_annotation_adapter
    26 from pyams_utils.adapter import adapter_config, get_annotation_adapter
       
    27 from pyams_utils.factory import factory_config
    28 
    28 
    29 from pyams_default_theme import _
    29 from pyams_default_theme import _
    30 
    30 
    31 
    31 
    32 #
    32 #
    34 #
    34 #
    35 
    35 
    36 CONTACT_DEFAULT_RENDERER_SETTINGS_KEY = 'pyams_content.contact.renderer:default'
    36 CONTACT_DEFAULT_RENDERER_SETTINGS_KEY = 'pyams_content.contact.renderer:default'
    37 
    37 
    38 
    38 
    39 @implementer(IContactParagraphDefaultRendererSettings)
    39 @factory_config(IContactParagraphDefaultRendererSettings)
    40 class ContactParagraphDefaultRendererSettings(Persistent, Location):
    40 class ContactParagraphDefaultRendererSettings(Persistent, Location):
    41     """Contact paragraph default renderer settings"""
    41     """Contact paragraph default renderer settings"""
    42 
    42 
    43     display_photo = FieldProperty(IContactParagraphDefaultRendererSettings['display_photo'])
    43     display_photo = FieldProperty(IContactParagraphDefaultRendererSettings['display_photo'])
    44     photo_position = FieldProperty(IContactParagraphDefaultRendererSettings['photo_position'])
    44     photo_position = FieldProperty(IContactParagraphDefaultRendererSettings['photo_position'])
    65 
    65 
    66 @adapter_config(context=IContactParagraph, provides=IContactParagraphDefaultRendererSettings)
    66 @adapter_config(context=IContactParagraph, provides=IContactParagraphDefaultRendererSettings)
    67 def contact_paragraph_default_renderer_settings_factory(context):
    67 def contact_paragraph_default_renderer_settings_factory(context):
    68     """Contact paragraph default renderer settings factory"""
    68     """Contact paragraph default renderer settings factory"""
    69     return get_annotation_adapter(context, CONTACT_DEFAULT_RENDERER_SETTINGS_KEY,
    69     return get_annotation_adapter(context, CONTACT_DEFAULT_RENDERER_SETTINGS_KEY,
    70                                   ContactParagraphDefaultRendererSettings)
    70                                   IContactParagraphDefaultRendererSettings)
    71 
    71 
    72 
    72 
    73 #
    73 #
    74 # Contact paragraph default renderer
    74 # Contact paragraph default renderer
    75 #
    75 #