|
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 packages |
|
19 from zope.schema import Bool, Choice, List, Set |
|
20 |
|
21 from pyams_content import _ |
|
22 # import interfaces |
|
23 from pyams_content.component.paragraph.interfaces import PARAGRAPH_FACTORIES_VOCABULARY |
|
24 from pyams_portal.interfaces import IPortletSettings |
|
25 |
|
26 |
|
27 class IParagraphContainerPortletSettings(IPortletSettings): |
|
28 """Paragraphs container portlet settings interface""" |
|
29 |
|
30 paragraphs = List(title=_("Selected paragraphs"), |
|
31 description=_("List of selected paragraphs; an empty selection means that " |
|
32 "all paragraphs will be selectable by following filters; otherwise, " |
|
33 "this selection will have priority"), |
|
34 value_type=Choice(vocabulary='PyAMS content paragraphs'), |
|
35 required=False) |
|
36 |
|
37 factories = Set(title=_("Paragraph types"), |
|
38 description=_("Select list of paragraph types you want to include; an empty " |
|
39 "selection means that all paragraphs types will be selected"), |
|
40 required=False, |
|
41 value_type=Choice(vocabulary=PARAGRAPH_FACTORIES_VOCABULARY)) |
|
42 |
|
43 anchors_only = Bool(title=_("Anchors only?"), |
|
44 description=_("If 'yes', only paragraphs set as 'anchors' will be selected"), |
|
45 required=True, |
|
46 default=False) |
|
47 |
|
48 |
|
49 class IParagraphNavigationPortletSettings(IPortletSettings): |
|
50 """Paragraphs container navigation settings interface""" |
|
51 |
|
52 paragraphs = List(title=_("Selected paragraphs"), |
|
53 description=_("List of paragraphs selected for navigation; an empty selection means that " |
|
54 "all paragraphs will be selectable by following filters; otherwise, " |
|
55 "this selection will have priority"), |
|
56 value_type=Choice(vocabulary='PyAMS content paragraphs'), |
|
57 required=False) |
|
58 |
|
59 factories = Set(title=_("Paragraph types"), |
|
60 description=_("Select list of paragraph types you want to use for navigation; an empty " |
|
61 "selection means that all paragraphs types will be selected"), |
|
62 required=False, |
|
63 value_type=Choice(vocabulary=PARAGRAPH_FACTORIES_VOCABULARY)) |
|
64 |
|
65 anchors_only = Bool(title=_("Anchors only?"), |
|
66 description=_("If 'no', all paragraphs will be used as navigation anchors"), |
|
67 required=True, |
|
68 default=True) |