|
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 from zope.interface import implementer |
|
16 from zope.schema.fieldproperty import FieldProperty |
|
17 |
|
18 from pyams_content.features.share.portlet.interfaces import IToolboxPortletSettings |
|
19 from pyams_portal.portlet import Portlet, PortletSettings, portlet_config |
|
20 from pyams_utils.factory import factory_config |
|
21 from pyams_utils.interfaces import VIEW_PERMISSION |
|
22 |
|
23 from pyams_content import _ |
|
24 |
|
25 |
|
26 TOOLBOX_PORTLET_NAME = 'pyams_content.portlet.toolbox' |
|
27 |
|
28 |
|
29 @implementer(IToolboxPortletSettings) |
|
30 @factory_config(provided=IToolboxPortletSettings) |
|
31 class ToolboxPortletSettings(PortletSettings): |
|
32 """Toolbox portlet settings""" |
|
33 |
|
34 allow_printing = FieldProperty(IToolboxPortletSettings['allow_printing']) |
|
35 allow_sharing = FieldProperty(IToolboxPortletSettings['allow_sharing']) |
|
36 |
|
37 |
|
38 @portlet_config(permission=VIEW_PERMISSION) |
|
39 class ToolboxPortet(Portlet): |
|
40 """Toolbox portlet""" |
|
41 |
|
42 name = TOOLBOX_PORTLET_NAME |
|
43 label = _("Toolbox") |
|
44 |
|
45 toolbar_css_class = 'fa fa-fw fa-print' |
|
46 |
|
47 settings_factory = IToolboxPortletSettings |