# HG changeset patch # User Thierry Florac # Date 1521102660 -3600 # Node ID 12e5bc30061a41bc08f41e94057794a650044c0e # Parent 4e76f8f239c213df8ea6b650bd1f72d60003c996 Added shared content properties preview diff -r 4e76f8f239c2 -r 12e5bc30061a src/pyams_default_theme/shared/common.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/shared/common.py Thu Mar 15 09:31:00 2018 +0100 @@ -0,0 +1,37 @@ +# +# Copyright (c) 2008-2015 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.features.renderer.interfaces import IContentRenderer +from pyams_content.shared.common.interfaces import IWfSharedContent +from pyams_default_theme.layer import IPyAMSDefaultLayer + +# import packages +from pyams_content.features.renderer.zmi import BaseContentRenderer +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config + + +@adapter_config(name='properties-preview', context=(IWfSharedContent, IPyAMSDefaultLayer), + provides=IContentRenderer) +@template_config(template='templates/content-preview.pt', layer=IPyAMSDefaultLayer) +class SharedContentRenderer(BaseContentRenderer): + """Shared content renderer""" + + weight = 1 + + i18n_context_attrs = ('title', ) diff -r 4e76f8f239c2 -r 12e5bc30061a src/pyams_default_theme/shared/templates/content-preview.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/shared/templates/content-preview.pt Thu Mar 15 09:31:00 2018 +0100 @@ -0,0 +1,1 @@ +