# HG changeset patch # User Damien Correia # Date 1535554528 -7200 # Node ID 4a57e6e76d5f0c85cfebb909bbf5a280244d27e0 # Parent c5e34981deac83385c75b0dba3720055929309de Added Title field for Raw HTML portlet. diff -r c5e34981deac -r 4a57e6e76d5f src/pyams_portal/portlets/html/__init__.py --- a/src/pyams_portal/portlets/html/__init__.py Tue Aug 28 15:42:39 2018 +0200 +++ b/src/pyams_portal/portlets/html/__init__.py Wed Aug 29 16:55:28 2018 +0200 @@ -40,6 +40,7 @@ class RawPortletSettings(PortletSettings): """Raw HTML code portlet settings""" + title = FieldProperty(IRawPortletSettings['title']) body = FieldProperty(IRawPortletSettings['body']) diff -r c5e34981deac -r 4a57e6e76d5f src/pyams_portal/portlets/html/interfaces.py --- a/src/pyams_portal/portlets/html/interfaces.py Tue Aug 28 15:42:39 2018 +0200 +++ b/src/pyams_portal/portlets/html/interfaces.py Wed Aug 29 16:55:28 2018 +0200 @@ -19,8 +19,7 @@ from pyams_portal.interfaces import IPortletSettings # import packages -from pyams_i18n.schema import I18nTextField, I18nHTMLField - +from pyams_i18n.schema import I18nTextField, I18nHTMLField, I18nTextLineField from pyams_portal import _ @@ -28,6 +27,8 @@ class IRawPortletSettings(IPortletSettings): """Raw HTML code portlet settings interface""" + title = I18nTextLineField(title=_("ยง Title"), + required=False) body = I18nTextField(title=_("Raw HTML code"), description=_("This HTML code will be used 'as is', without any transformation. Use with " "care!!"), diff -r c5e34981deac -r 4a57e6e76d5f src/pyams_portal/portlets/html/skin/__init__.py --- a/src/pyams_portal/portlets/html/skin/__init__.py Tue Aug 28 15:42:39 2018 +0200 +++ b/src/pyams_portal/portlets/html/skin/__init__.py Wed Aug 29 16:55:28 2018 +0200 @@ -30,7 +30,7 @@ @adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, IRawPortletSettings), provides=IPortletRenderer) -@template_config(template='html.pt', layer=IPyAMSLayer) +@template_config(template='raw.pt', layer=IPyAMSLayer) class RawPortletDefaultRenderer(PortletRenderer): """Raw HTML portlet renderer""" diff -r c5e34981deac -r 4a57e6e76d5f src/pyams_portal/portlets/html/skin/raw.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_portal/portlets/html/skin/raw.pt Wed Aug 29 16:55:28 2018 +0200 @@ -0,0 +1,3 @@ +

Title

+HTML code diff -r c5e34981deac -r 4a57e6e76d5f src/pyams_portal/portlets/html/zmi/__init__.py --- a/src/pyams_portal/portlets/html/zmi/__init__.py Tue Aug 28 15:42:39 2018 +0200 +++ b/src/pyams_portal/portlets/html/zmi/__init__.py Wed Aug 29 16:55:28 2018 +0200 @@ -61,7 +61,7 @@ @adapter_config(context=(Interface, IPyAMSLayer, Interface, IRawPortletSettings), provides=IPortletPreviewer) -@template_config(template='preview.pt', layer=IPyAMSLayer) +@template_config(template='raw-preview.pt', layer=IPyAMSLayer) class RawPortletPreviewer(PortletPreviewer): """Raw HTML portlet previewer""" diff -r c5e34981deac -r 4a57e6e76d5f src/pyams_portal/portlets/html/zmi/raw-preview.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_portal/portlets/html/zmi/raw-preview.pt Wed Aug 29 16:55:28 2018 +0200 @@ -0,0 +1,5 @@ + +
+
+HTML code