# HG changeset patch # User Thierry Florac # Date 1535362287 -7200 # Node ID 81cd2db6df7a30e4b81420e0fed8b36906e4e04a # Parent 5d82a621433bf0592f61703cf905077e3ace50ac Removed header paragraph renderer diff -r 5d82a621433b -r 81cd2db6df7a src/pyams_default_theme/component/paragraph/__init__.py --- a/src/pyams_default_theme/component/paragraph/__init__.py Mon Aug 27 11:31:05 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/__init__.py Mon Aug 27 11:31:27 2018 +0200 @@ -40,8 +40,12 @@ def update(self): super(ParagraphPreviewPage, self).update() - self.renderer.language = self.language - self.renderer.update() + if self.renderer is not None: + self.renderer.language = self.language + self.renderer.update() def render(self): - return self.renderer.render() + if self.renderer is not None: + return self.renderer.render() + else: + return '' diff -r 5d82a621433b -r 81cd2db6df7a src/pyams_default_theme/component/paragraph/header.py --- a/src/pyams_default_theme/component/paragraph/header.py Mon Aug 27 11:31:05 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# -# Copyright (c) 2008-2017 Thierry Florac -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# - -__docformat__ = 'restructuredtext' - - -# import standard library - -# import interfaces -from pyams_content.component.paragraph.interfaces.header import IHeaderParagraph -from pyams_content.features.renderer.interfaces import IContentRenderer -from pyams_skin.layer import IPyAMSLayer - -# import packages -from pyams_content.features.renderer.skin import BaseContentRenderer -from pyams_template.template import template_config -from pyams_utils.adapter import adapter_config - -from pyams_default_theme import _ - - -# -# Header paragraph default renderer -# - -@adapter_config(name='default', context=(IHeaderParagraph, IPyAMSLayer), provides=IContentRenderer) -@template_config(template='templates/header-default.pt', layer=IPyAMSLayer) -class HeaderParagraphDefaultRenderer(BaseContentRenderer): - """Header paragraph default renderer""" - - label = _("Default header renderer") - - i18n_context_attrs = ('header', ) diff -r 5d82a621433b -r 81cd2db6df7a src/pyams_default_theme/component/paragraph/templates/header-default.pt --- a/src/pyams_default_theme/component/paragraph/templates/header-default.pt Mon Aug 27 11:31:05 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -
header