Updated spacer portlet
authorThierry Florac <tflorac@ulthar.net>
Wed, 28 Nov 2018 17:52:02 +0100
changeset 222 50b97b22bdd7
parent 221 dadc318d0871
child 223 8a435c645a72
Updated spacer portlet
src/pyams_portal/portlets/spacer/skin/__init__.py
src/pyams_portal/portlets/spacer/skin/spacer.pt
src/pyams_portal/portlets/spacer/skin/templates/spacer-double.pt
src/pyams_portal/portlets/spacer/skin/templates/spacer-ruler.pt
src/pyams_portal/portlets/spacer/skin/templates/spacer.pt
src/pyams_portal/portlets/spacer/zmi/preview.pt
--- a/src/pyams_portal/portlets/spacer/skin/__init__.py	Tue Nov 27 13:55:31 2018 +0100
+++ b/src/pyams_portal/portlets/spacer/skin/__init__.py	Wed Nov 28 17:52:02 2018 +0100
@@ -24,9 +24,33 @@
 from pyams_portal import _
 
 
-@adapter_config(context=(IPortalContext,IPyAMSLayer, Interface, ISpacerPortletSettings), provides=IPortletRenderer)
-@template_config(template='spacer.pt', layer=IPyAMSLayer)
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISpacerPortletSettings),
+                provides=IPortletRenderer)
+@template_config(template='templates/spacer.pt', layer=IPyAMSLayer)
 class SpacerPortletDefaultRenderer(PortletRenderer):
     """Spacer portlet renderer"""
 
-    label = _("Default spacer renderer")
+    label = _("Default spacer")
+    weight = 1
+
+
+@adapter_config(name='double-spacer',
+                context=(IPortalContext, IPyAMSLayer, Interface, ISpacerPortletSettings),
+                provides=IPortletRenderer)
+@template_config(template='templates/spacer-double.pt', layer=IPyAMSLayer)
+class DoubleSpacerPortletDefaultRenderer(PortletRenderer):
+    """Double spacer portlet renderer"""
+
+    label = _("Double spacer")
+    weight = 2
+
+
+@adapter_config(name='double-ruler',
+                context=(IPortalContext, IPyAMSLayer, Interface, ISpacerPortletSettings),
+                provides=IPortletRenderer)
+@template_config(template='templates/spacer-ruler.pt', layer=IPyAMSLayer)
+class DoubleRulerSpacerPortletDefaultRenderer(PortletRenderer):
+    """Double spacer with ruler portlet renderer"""
+
+    label = _("Double spacer with horizontal ruler")
+    weight = 3
--- a/src/pyams_portal/portlets/spacer/skin/spacer.pt	Tue Nov 27 13:55:31 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-<hr />
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_portal/portlets/spacer/skin/templates/spacer-double.pt	Wed Nov 28 17:52:02 2018 +0100
@@ -0,0 +1,1 @@
+<hr class="noborder" />
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_portal/portlets/spacer/skin/templates/spacer-ruler.pt	Wed Nov 28 17:52:02 2018 +0100
@@ -0,0 +1,1 @@
+<hr />
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_portal/portlets/spacer/skin/templates/spacer.pt	Wed Nov 28 17:52:02 2018 +0100
@@ -0,0 +1,1 @@
+<hr class="simple noborder" />
\ No newline at end of file
--- a/src/pyams_portal/portlets/spacer/zmi/preview.pt	Tue Nov 27 13:55:31 2018 +0100
+++ b/src/pyams_portal/portlets/spacer/zmi/preview.pt	Wed Nov 28 17:52:02 2018 +0100
@@ -1,1 +1,1 @@
-<hr />
\ No newline at end of file
+<hr class="simple noborder" />
\ No newline at end of file