33 __docformat__ = 'restructuredtext' |
33 __docformat__ = 'restructuredtext' |
34 |
34 |
35 from pyams_content import _ |
35 from pyams_content import _ |
36 |
36 |
37 |
37 |
38 FOLDER_REDIRECT_DISPLAY_MODE = 'redirect' |
38 SITE_CONTAINER_REDIRECT_MODE = 'redirect' |
39 FOLDER_TEMPLATE_DISPLAY_MODE = 'template' |
39 SITE_CONTAINER_TEMPLATE_MODE = 'template' |
40 |
40 |
41 FOLDER_DISPLAY_MODES = OrderedDict(( |
41 SITE_CONTAINER_NAVIGATION_MODES = OrderedDict(( |
42 (FOLDER_REDIRECT_DISPLAY_MODE, _("Redirect to first visible sub-folder or content")), |
42 (SITE_CONTAINER_REDIRECT_MODE, _("Redirect to first visible sub-folder or content")), |
43 (FOLDER_TEMPLATE_DISPLAY_MODE, _("Use presentation template")) |
43 (SITE_CONTAINER_TEMPLATE_MODE, _("Use presentation template")) |
44 )) |
44 )) |
45 |
45 |
46 FOLDER_DISPLAY_MODE_VOCABULARY = SimpleVocabulary([SimpleTerm(v, title=t) |
46 SITE_CONTAINER_NAVIGATION_MODES_VOCABULARY = SimpleVocabulary([ |
47 for v, t in FOLDER_DISPLAY_MODES.items()]) |
47 SimpleTerm(v, title=t) |
|
48 for v, t in SITE_CONTAINER_NAVIGATION_MODES.items() |
|
49 ]) |
48 |
50 |
49 |
51 |
50 class ISiteElement(IContained, IDeletableElement): |
52 class ISiteElement(IContained, IDeletableElement): |
51 """Base site element interface""" |
53 """Base site element interface""" |
52 |
54 |
112 required=False) |
114 required=False) |
113 |
115 |
114 navigation_mode = Choice(title=_("Navigation mode"), |
116 navigation_mode = Choice(title=_("Navigation mode"), |
115 description=_("Folder behaviour when navigating to folder URL"), |
117 description=_("Folder behaviour when navigating to folder URL"), |
116 required=True, |
118 required=True, |
117 vocabulary=FOLDER_DISPLAY_MODE_VOCABULARY, |
119 vocabulary=SITE_CONTAINER_NAVIGATION_MODES_VOCABULARY, |
118 default=FOLDER_REDIRECT_DISPLAY_MODE) |
120 default=SITE_CONTAINER_REDIRECT_MODE) |
119 |
121 |
120 |
122 |
121 class ISiteFolderFactory(Interface): |
123 class ISiteFolderFactory(Interface): |
122 """Site folder factory interface""" |
124 """Site folder factory interface""" |
123 |
125 |
151 |
153 |
152 notepad = Text(title=_("Notepad"), |
154 notepad = Text(title=_("Notepad"), |
153 description=_("Internal information to be known about this content"), |
155 description=_("Internal information to be known about this content"), |
154 required=False) |
156 required=False) |
155 |
157 |
|
158 navigation_mode = Choice(title=_("Navigation mode"), |
|
159 description=_("Site behaviour when navigating to site URL"), |
|
160 required=True, |
|
161 vocabulary=SITE_CONTAINER_NAVIGATION_MODES_VOCABULARY, |
|
162 default=SITE_CONTAINER_TEMPLATE_MODE) |
|
163 |
156 |
164 |
157 class ISiteManagerFactory(Interface): |
165 class ISiteManagerFactory(Interface): |
158 """Site manager factory interface""" |
166 """Site manager factory interface""" |
159 |
167 |
160 |
168 |