|
1 # |
|
2 # Copyright (c) 2008-2018 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.portlet.content.interfaces import ISharedContentPortletSettings |
|
20 from pyams_utils.interfaces import VIEW_PERMISSION |
|
21 |
|
22 # import packages |
|
23 from pyams_portal.portlet import PortletSettings, portlet_config, Portlet |
|
24 from zope.interface import implementer |
|
25 |
|
26 from pyams_content import _ |
|
27 |
|
28 |
|
29 SHARED_CONTENT_PORTLET_NAME = 'pyams_content.portlet.content' |
|
30 |
|
31 |
|
32 @implementer(ISharedContentPortletSettings) |
|
33 class SharedContentPortletSettings(PortletSettings): |
|
34 """Shared content portlet persistent settings""" |
|
35 |
|
36 |
|
37 @portlet_config(permission=VIEW_PERMISSION) |
|
38 class SharedContentPortlet(Portlet): |
|
39 """Shared content portlet""" |
|
40 |
|
41 name = SHARED_CONTENT_PORTLET_NAME |
|
42 label = _("Context content") |
|
43 |
|
44 settings_class = SharedContentPortletSettings |