src/pyams_content/component/paragraph/zmi/html.py
changeset 487 093f201e3168
parent 446 4ce676e4859f
child 497 32f7f9950df3
equal deleted inserted replaced
486:cb67e71dafff 487:093f201e3168
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.component.association.interfaces import IAssociationTarget
    19 from pyams_content.component.association.interfaces import IAssociationTarget
    20 from pyams_content.component.association.zmi.interfaces import IAssociationsParentForm
    20 from pyams_content.component.association.zmi.interfaces import IAssociationsParentForm
    21 from pyams_content.component.illustration.interfaces import IIllustration
    21 from pyams_content.component.illustration.interfaces import IIllustration
    22 from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphFactorySettings, \
    22 from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphFactorySettings, \
    23     IParagraphContainer, IParagraphPreview
    23     IParagraphContainer, IParagraphRenderer
    24 from pyams_content.component.paragraph.interfaces.html import IHTMLParagraph, IRawParagraph, RAW_PARAGRAPH_TYPE, \
    24 from pyams_content.component.paragraph.interfaces.html import IHTMLParagraph, IRawParagraph, RAW_PARAGRAPH_TYPE, \
    25     HTML_PARAGRAPH_TYPE
    25     HTML_PARAGRAPH_TYPE
    26 from pyams_content.component.paragraph.zmi.interfaces import IParagraphInnerEditor, IParagraphContainerView
    26 from pyams_content.component.paragraph.zmi.interfaces import IParagraphInnerEditor, IParagraphContainerView
    27 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
    27 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
    28 from pyams_form.interfaces.form import IInnerForm, IEditFormButtons
    28 from pyams_form.interfaces.form import IInnerForm, IEditFormButtons
   158 class RawParagraphInnerAJAXEditForm(BaseParagraphAJAXEditForm, RawParagraphInnerEditForm):
   158 class RawParagraphInnerAJAXEditForm(BaseParagraphAJAXEditForm, RawParagraphInnerEditForm):
   159     """Raw HTML paragraph inner edit form, JSON renderer"""
   159     """Raw HTML paragraph inner edit form, JSON renderer"""
   160 
   160 
   161 
   161 
   162 #
   162 #
   163 # Raw HTML paragraph preview
   163 # Raw HTML paragraph renderer
   164 #
   164 #
   165 
   165 
   166 @adapter_config(context=(IRawParagraph, IPyAMSLayer), provides=IParagraphPreview)
   166 @adapter_config(context=(IRawParagraph, IPyAMSLayer), provides=IParagraphRenderer)
   167 @template_config(template='templates/raw-preview.pt', layer=IPyAMSLayer)
   167 @template_config(template='templates/raw-render.pt', layer=IPyAMSLayer)
   168 class RawParagraphPreview(BaseContentProvider):
   168 class RawParagraphRenderer(BaseContentProvider):
   169     """Raw HTML paragraph preview"""
   169     """Raw HTML paragraph renderer"""
   170 
   170 
   171     language = None
   171     language = None
   172 
   172 
   173     def update(self):
   173     def update(self):
   174         i18n = II18n(self.context)
   174         i18n = II18n(self.context)
   338             })
   338             })
   339         return output
   339         return output
   340 
   340 
   341 
   341 
   342 #
   342 #
   343 # Rich text paragraph preview
   343 # Rich text paragraph renderer
   344 #
   344 #
   345 
   345 
   346 @adapter_config(context=(IHTMLParagraph, IPyAMSLayer), provides=IParagraphPreview)
   346 @adapter_config(context=(IHTMLParagraph, IPyAMSLayer), provides=IParagraphRenderer)
   347 @template_config(template='templates/html-preview.pt', layer=IPyAMSLayer)
   347 @template_config(template='templates/html-render.pt', layer=IPyAMSLayer)
   348 class HTMLParagraphPreview(BaseContentProvider):
   348 class HTMLParagraphRenderer(BaseContentProvider):
   349     """Rich text paragraph preview"""
   349     """Rich text paragraph renderer"""
   350 
   350 
   351     illustration = None
   351     illustration = None
   352     illustration_renderer = None
   352     illustration_renderer = None
   353     language = None
   353     language = None
   354 
   354