# HG changeset patch # User Thierry Florac # Date 1543226655 -3600 # Node ID 830495568da456bd053cb77d4d6c5846b088c13a # Parent cd3ac4329f32d2e672a0917124ef5c08c5ef036f Added site summary portlet renderer diff -r cd3ac4329f32 -r 830495568da4 src/pyams_default_theme/shared/site/portlet/__init__.py --- a/src/pyams_default_theme/shared/site/portlet/__init__.py Mon Nov 26 11:03:43 2018 +0100 +++ b/src/pyams_default_theme/shared/site/portlet/__init__.py Mon Nov 26 11:04:15 2018 +0100 @@ -26,13 +26,8 @@ from pyams_default_theme import _ -@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISiteContainerSummaryPortletSettings), - provides=IPortletRenderer) -@template_config(template='templates/site-summary.pt', layer=IPyAMSLayer) -class SiteContainerSummaryPortletDefaultRenderer(PortletRenderer): - """Site container summary portlet default renderer""" - - label = _("Site container summary") +class BaseSiteSummaryPortletRenderer(PortletRenderer): + """Base site summary portlet renderer""" @property def visible_items(self): @@ -42,3 +37,22 @@ yield from filter(lambda x: x is not None, [registry.queryMultiAdapter((item, self.request), IContentSummaryInfo) for item in container.get_visible_items(self.request)]) + + +@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISiteContainerSummaryPortletSettings), + provides=IPortletRenderer) +@template_config(template='templates/site-summary.pt', layer=IPyAMSLayer) +class SiteContainerSummaryPortletDefaultRenderer(BaseSiteSummaryPortletRenderer): + """Site container summary portlet default renderer""" + + label = _("Site container summary") + + +@adapter_config(name='summary-panels', + context=(IPortalContext, IPyAMSLayer, Interface, ISiteContainerSummaryPortletSettings), + provides=IPortletRenderer) +@template_config(template='templates/site-panels.pt', layer=IPyAMSLayer) +class SiteContainerSummaryPortletPanelsRenderer(BaseSiteSummaryPortletRenderer): + """Site container summary portlet panels renderer""" + + label = _("Vertical panels with panoramic illustrations") diff -r cd3ac4329f32 -r 830495568da4 src/pyams_default_theme/shared/site/portlet/templates/site-panels.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/shared/site/portlet/templates/site-panels.pt Mon Nov 26 11:04:15 2018 +0100 @@ -0,0 +1,35 @@ +
+

${i18n:settings.title}

+ +
+
\ No newline at end of file diff -r cd3ac4329f32 -r 830495568da4 src/pyams_default_theme/shared/site/portlet/templates/site-summary.pt --- a/src/pyams_default_theme/shared/site/portlet/templates/site-summary.pt Mon Nov 26 11:03:43 2018 +0100 +++ b/src/pyams_default_theme/shared/site/portlet/templates/site-summary.pt Mon Nov 26 11:04:15 2018 +0100 @@ -1,6 +1,7 @@
+

${i18n:settings.title}

@@ -17,7 +18,9 @@
-

${item.title}

+ +

${item.title}

+
${structure:tales:html(item.header)}