Always display navigation properties
authorThierry Florac <tflorac@ulthar.net>
Wed, 19 Sep 2018 15:08:06 +0200
changeset 962 7bff93e41787
parent 961 34845a0aa1ee
child 963 fff756709617
Always display navigation properties
src/pyams_content/shared/site/zmi/folder.py
--- a/src/pyams_content/shared/site/zmi/folder.py	Wed Sep 19 11:17:07 2018 +0200
+++ b/src/pyams_content/shared/site/zmi/folder.py	Wed Sep 19 15:08:06 2018 +0200
@@ -9,33 +9,31 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-from pyams_form.group import NamedWidgetsGroup
-from pyams_form.interfaces.form import IInnerSubForm
 
 __docformat__ = 'restructuredtext'
 
+from pyramid.events import subscriber
+from pyramid.path import DottedNameResolver
+from z3c.form import field
+from z3c.form.interfaces import IDataExtractedEvent
+from zope.interface import Interface, Invalid
+from zope.intid.interfaces import IIntIds
+from zope.schema import Text, Int
 
-# import standard library
-
-# import interfaces
 from pyams_content.interfaces import MANAGE_SITE_PERMISSION, MANAGE_TOOL_PERMISSION
 from pyams_content.shared.common.interfaces import IBaseSharedTool
+from pyams_content.shared.common.zmi.manager import SharedToolPropertiesEditForm
 from pyams_content.shared.site.interfaces import ISiteContainer, ISiteManager, ISiteFolder
+from pyams_content.shared.site.zmi.widget import SiteManagerFoldersSelectorFieldWidget
+from pyams_form.form import AJAXAddForm, ajax_config
+from pyams_form.group import NamedWidgetsGroup
+from pyams_form.interfaces.form import IInnerSubForm
 from pyams_i18n.interfaces import INegotiator, II18n
+from pyams_i18n.schema import I18nTextLineField
+from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.interfaces.container import ITableElementName, ITableElementEditor
 from pyams_skin.interfaces.viewlet import IToolbarAddingMenu, IMenuHeader
 from pyams_skin.layer import IPyAMSLayer
-from pyams_zmi.interfaces.menu import ISiteManagementMenu
-from pyams_zmi.layer import IAdminLayer
-from z3c.form.interfaces import IDataExtractedEvent
-from zope.intid.interfaces import IIntIds
-
-# import packages
-from pyams_content.shared.common.zmi.manager import SharedToolPropertiesEditForm
-from pyams_content.shared.site.zmi.widget import SiteManagerFoldersSelectorFieldWidget
-from pyams_form.form import AJAXAddForm, ajax_config
-from pyams_i18n.schema import I18nTextLineField
-from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.table import DefaultElementEditorAdapter
 from pyams_skin.viewlet.toolbar import ToolbarMenuItem
 from pyams_utils.adapter import adapter_config, ContextRequestAdapter
@@ -45,11 +43,8 @@
 from pyams_utils.url import absolute_url
 from pyams_viewlet.viewlet import viewlet_config
 from pyams_zmi.form import AdminDialogAddForm, InnerAdminEditForm
-from pyramid.events import subscriber
-from pyramid.path import DottedNameResolver
-from z3c.form import field
-from zope.interface import Interface, Invalid
-from zope.schema import Text, Int
+from pyams_zmi.interfaces.menu import ISiteManagementMenu
+from pyams_zmi.layer import IAdminLayer
 
 from pyams_content import _
 
@@ -190,7 +185,7 @@
     legend = _("Site folder properties")
 
     fields = field.Fields(ISiteFolder).select('title', 'short_name', 'heading', 'notepad') + \
-        field.Fields(IBaseSharedTool).select('shared_content_workflow')
+             field.Fields(IBaseSharedTool).select('shared_content_workflow')
 
 
 @adapter_config(name='navigation', context=(ISiteFolder, IPyAMSLayer, SiteFolderPropertiesEditForm),
@@ -223,5 +218,5 @@
                                          legend=self.main_group_legend,
                                          css_class=self.main_group_class,
                                          switch=True,
-                                         display_mode='auto'))
+                                         display_mode='always'))
         super(SiteFolderNavigationPropertiesEditForm, self).updateGroups()