--- a/src/pyams_portal/portlets/html/skin/__init__.py Fri Dec 14 18:35:55 2018 +0100
+++ b/src/pyams_portal/portlets/html/skin/__init__.py Fri Dec 14 23:07:52 2018 +0100
@@ -9,6 +9,8 @@
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
+from pyams_utils.interfaces.text import IHTMLRenderer
+
__docformat__ = 'restructuredtext'
@@ -71,6 +73,30 @@
#
+# ReStructuredText renderer
+#
+
+@adapter_config(name='rest',
+ context=(IPortalContext, IPyAMSLayer, Interface, IRawPortletSettings),
+ provides=IPortletRenderer)
+@template_config(template='templates/code.pt', layer=IPyAMSLayer)
+class RawPortletSourceRestRenderer(PortletRenderer):
+ """ReStructured text portlet renderer"""
+
+ label = _("ReStructured text renderer")
+ weight = 20
+
+ @property
+ def body(self):
+ code = II18n(self.settings).query_attribute('body', request=self.request)
+ if code:
+ renderer = self.request.registry.queryMultiAdapter((code, self.request), IHTMLRenderer, name='rest')
+ if renderer is not None:
+ return renderer.render()
+ return ''
+
+
+#
# Formatted HTML renderer
#