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.shared.common.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 pyams_utils.factory import factory_config |
|
25 from zope.interface import implementer |
|
26 |
|
27 from pyams_content import _ |
|
28 |
|
29 |
|
30 SHARED_CONTENT_PORTLET_NAME = 'pyams_content.portlet.content' |
|
31 |
|
32 |
|
33 @implementer(ISharedContentPortletSettings) |
|
34 @factory_config(provided=ISharedContentPortletSettings) |
|
35 class SharedContentPortletSettings(PortletSettings): |
|
36 """Shared content portlet persistent settings""" |
|
37 |
|
38 |
|
39 @portlet_config(permission=VIEW_PERMISSION) |
|
40 class SharedContentPortlet(Portlet): |
|
41 """Shared content portlet""" |
|
42 |
|
43 name = SHARED_CONTENT_PORTLET_NAME |
|
44 label = _("Context content") |
|
45 |
|
46 settings_factory = ISharedContentPortletSettings |
|