Automatically apply "edito" class in paragraph preview
authorThierry Florac <tflorac@ulthar.net>
Wed, 28 Nov 2018 18:09:35 +0100
changeset 264 a57d4369f179
parent 263 37a0b0a69b02
child 265 914dd6e8cf6d
Automatically apply "edito" class in paragraph preview
src/pyams_default_theme/component/paragraph/__init__.py
--- a/src/pyams_default_theme/component/paragraph/__init__.py	Wed Nov 28 17:53:42 2018 +0100
+++ b/src/pyams_default_theme/component/paragraph/__init__.py	Wed Nov 28 18:09:35 2018 +0100
@@ -12,19 +12,14 @@
 
 __docformat__ = 'restructuredtext'
 
+from zope.interface import implementer
 
-# import standard library
-
-# import interfaces
 from pyams_content.component.paragraph.interfaces import IBaseParagraph
 from pyams_content.features.preview.interfaces import IPreviewView
 from pyams_default_theme.layer import IPyAMSDefaultLayer
-from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
-
-# import packages
 from pyams_default_theme.page import BasePreviewPage
 from pyams_pagelet.pagelet import pagelet_config
-from zope.interface import implementer
+from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
 
 
 @pagelet_config(name='preview.html', context=IBaseParagraph, layer=IPyAMSDefaultLayer,
@@ -46,6 +41,6 @@
 
     def render(self):
         if self.renderer is not None:
-            return self.renderer.render()
+            return '<div class="edito">{}</div>'.format(self.renderer.render())
         else:
             return ''