10 # FOR A PARTICULAR PURPOSE. |
10 # FOR A PARTICULAR PURPOSE. |
11 # |
11 # |
12 |
12 |
13 __docformat__ = 'restructuredtext' |
13 __docformat__ = 'restructuredtext' |
14 |
14 |
15 |
15 from zope.interface import Attribute, Interface |
16 # import standard library |
16 from zope.schema import Bool, Choice, Int, Set |
17 |
17 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary |
18 # import interfaces |
18 |
19 from pyams_content.shared.common.interfaces import ISharedContent, IWfSharedContent, ISharedTool, \ |
19 from pyams_content.shared.common.interfaces import CONTENT_TYPES_VOCABULARY, ISharedContent, ISharedTool, \ |
20 CONTENT_TYPES_VOCABULARY |
20 IWfSharedContent |
21 from pyams_content.shared.common.interfaces.types import ALL_DATA_TYPES_VOCABULARY |
21 from pyams_content.shared.common.interfaces.types import ALL_DATA_TYPES_VOCABULARY |
22 from pyams_sequence.interfaces import IInternalReferencesList |
22 from pyams_sequence.interfaces import IInternalReferencesList |
23 |
|
24 # import packages |
|
25 from pyams_thesaurus.schema import ThesaurusTermsListField |
23 from pyams_thesaurus.schema import ThesaurusTermsListField |
26 from zope.interface import Interface, Attribute |
|
27 from zope.schema import Set, Choice, Bool, Int |
|
28 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm |
|
29 |
24 |
30 from pyams_content import _ |
25 from pyams_content import _ |
31 |
26 |
32 |
27 |
33 VIEW_CONTENT_TYPE = 'view' |
28 VIEW_CONTENT_TYPE = 'view' |
34 VIEW_CONTENT_NAME = _('View') |
29 VIEW_CONTENT_NAME = _('View') |
35 |
|
36 |
30 |
37 CREATION_DATE_ORDER = 'created_date' |
31 CREATION_DATE_ORDER = 'created_date' |
38 UPDATE_DATE_ORDER = 'modified_date' |
32 UPDATE_DATE_ORDER = 'modified_date' |
39 PUBLICATION_DATE_ORDER = 'publication_date' |
33 PUBLICATION_DATE_ORDER = 'publication_date' |
40 FIRSTPUBLICATION_DATE_ORDER = 'first_publication_date' |
34 FIRSTPUBLICATION_DATE_ORDER = 'first_publication_date' |
157 """Filter items after catalog query""" |
151 """Filter items after catalog query""" |
158 |
152 |
159 |
153 |
160 VIEW_REFERENCES_SETTINGS_KEY = 'pyams_content.view.references' |
154 VIEW_REFERENCES_SETTINGS_KEY = 'pyams_content.view.references' |
161 |
155 |
162 |
|
163 ALWAYS_REFERENCE_MODE = 'always' |
156 ALWAYS_REFERENCE_MODE = 'always' |
164 IFEMPTY_REFERENCE_MODE = 'if_empty' |
157 IFEMPTY_REFERENCE_MODE = 'if_empty' |
165 |
158 |
166 REFERENCES_MODES = {ALWAYS_REFERENCE_MODE: _("Always include selected internal references"), |
159 REFERENCES_MODES = { |
167 IFEMPTY_REFERENCE_MODE: _("Include selected internal references only if empty")} |
160 ALWAYS_REFERENCE_MODE: _("Always include selected internal references"), |
168 |
161 IFEMPTY_REFERENCE_MODE: _("Include selected internal references only if empty") |
169 REFERENCES_MODES_VOCABULARY = SimpleVocabulary([SimpleTerm(v, title=t) |
162 } |
170 for v, t in REFERENCES_MODES.items()]) |
163 |
|
164 REFERENCES_MODES_VOCABULARY = SimpleVocabulary([SimpleTerm(v, title=t) for v, t in REFERENCES_MODES.items()]) |
171 |
165 |
172 |
166 |
173 class IViewInternalReferencesSettings(IViewSettings, IInternalReferencesList): |
167 class IViewInternalReferencesSettings(IViewSettings, IInternalReferencesList): |
174 """View internal references settings""" |
168 """View internal references settings""" |
175 |
169 |