equal
deleted
inserted
replaced
|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 |
|
16 # import standard library |
|
17 |
|
18 # import interfaces |
|
19 from pyams_content.features.renderer.interfaces import IContentRenderer |
|
20 from pyams_content.shared.view.interfaces import IWfView |
|
21 from pyams_skin.layer import IPyAMSLayer |
|
22 |
|
23 # import packages |
|
24 from pyams_content.features.renderer.zmi import BaseContentRenderer |
|
25 from pyams_template.template import template_config |
|
26 from pyams_utils.adapter import adapter_config |
|
27 |
|
28 |
|
29 @adapter_config(name='view-render', context=(IWfView, IPyAMSLayer), provides=IContentRenderer) |
|
30 @template_config(template='templates/render.pt', layer=IPyAMSLayer) |
|
31 class ViewRenderer(BaseContentRenderer): |
|
32 """Shared view renderer""" |
|
33 |
|
34 weight = 20 |
|
35 |
|
36 @property |
|
37 def items(self): |
|
38 return self.context.get_results(self.context) |