Updated paragraph renderer
authorThierry Florac <thierry.florac@onf.fr>
Fri, 07 Sep 2018 16:44:22 +0200
changeset 135 3ebcbb1f52a2
parent 130 f4f8dccfee8b (current diff)
parent 134 ffb1f0d3b85b (diff)
child 136 06dae6db642a
Updated paragraph renderer
src/pyams_default_theme/component/paragraph/milestone.py
src/pyams_default_theme/component/paragraph/verbatim.py
--- a/src/pyams_default_theme/component/paragraph/milestone.py	Thu Sep 06 17:44:38 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/milestone.py	Fri Sep 07 16:44:22 2018 +0200
@@ -18,15 +18,13 @@
 # import interfaces
 from pyams_content.component.paragraph.interfaces.milestone import IMilestoneParagraph
 from pyams_content.features.renderer.interfaces import IContentRenderer
-from pyams_skin.layer import IPyAMSLayer
-
 # import packages
 from pyams_content.features.renderer.skin import BaseContentRenderer
+from pyams_default_theme import _
+from pyams_skin.layer import IPyAMSLayer
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config
 
-from pyams_default_theme import _
-
 
 #
 # Milestone paragraph default renderer
@@ -40,4 +38,4 @@
     label = _("Default milestones renderer")
     weight = 1
 
-    i18n_context_attrs = ('title',)
+    i18n_context_attrs = ('title', 'body')
--- a/src/pyams_default_theme/component/paragraph/verbatim.py	Thu Sep 06 17:44:38 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/verbatim.py	Fri Sep 07 16:44:22 2018 +0200
@@ -15,26 +15,23 @@
 
 # import standard library
 from persistent import Persistent
+from zope.interface import implementer
+from zope.location import Location
+from zope.schema.fieldproperty import FieldProperty
 
 # import interfaces
 from pyams_content.component.illustration.interfaces import IIllustration
 from pyams_content.component.paragraph.interfaces.verbatim import IVerbatimParagraph
 from pyams_content.features.renderer.interfaces import IContentRenderer
+# import packages
+from pyams_content.features.renderer.skin import BaseContentRenderer
+from pyams_default_theme import _
 from pyams_default_theme.component.paragraph.interfaces.verbatim import IVerbatimParagraphRendererSettings, \
     ILateralVerbatimParagraphRendererSettings, IDefaultVerbatimParagraphRendererSettings
 from pyams_i18n.interfaces import II18n
 from pyams_skin.layer import IPyAMSLayer
-
-# import packages
-from pyams_content.features.renderer.skin import BaseContentRenderer
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config, get_annotation_adapter
-from zope.interface import implementer
-from zope.location import locate, Location
-from zope.schema.fieldproperty import FieldProperty
-
-from pyams_default_theme import _
-
 
 #
 # Verbatim paragraph default renderer settings
@@ -97,15 +94,6 @@
     i18n_context_attrs = ('title', 'quote', 'charge')
     illustration_renderer = None
 
-    def update(self):
-        super(BaseVerbatimParagraphRenderer, self).update()
-        if self.settings.can_display_illustration():
-            illustration = IIllustration(self.context, None)
-            renderer = illustration.get_renderer(self.request)
-            if renderer is not None:
-                renderer.update()
-                self.illustration_renderer = renderer
-
 
 @adapter_config(name='default', context=(IVerbatimParagraph, IPyAMSLayer), provides=IContentRenderer)
 @template_config(template='templates/verbatim-default.pt', layer=IPyAMSLayer)