Updated inner forms base class
authorThierry Florac <thierry.florac@onf.fr>
Mon, 18 Jan 2016 18:00:34 +0100
changeset 13 e900be5278fb
parent 12 be368627227a
child 14 7ca62a7a465b
Updated inner forms base class
src/pyams_ldap/zmi/plugin.py
--- a/src/pyams_ldap/zmi/plugin.py	Thu Oct 08 09:57:59 2015 +0200
+++ b/src/pyams_ldap/zmi/plugin.py	Mon Jan 18 18:00:34 2016 +0100
@@ -32,7 +32,7 @@
 from zope.component.interfaces import ISite
 
 # import packages
-from pyams_form.form import AJAXAddForm, AJAXEditForm, InnerEditForm, InnerAddForm
+from pyams_form.form import AJAXAddForm, AJAXEditForm
 from pyams_form.search import SearchView, SearchResultsView
 from pyams_ldap.plugin import LDAPPlugin
 from pyams_ldap.query import LDAPQuery
@@ -47,7 +47,8 @@
 from pyams_utils.registry import query_utility
 from pyams_utils.url import absolute_url
 from pyams_viewlet.viewlet import viewlet_config, Viewlet
-from pyams_zmi.form import AdminDialogAddForm, AdminDialogEditForm, AdminDialogDisplayForm
+from pyams_zmi.form import AdminDialogAddForm, AdminDialogEditForm, AdminDialogDisplayForm, InnerAdminAddForm, \
+    InnerAdminEditForm
 from pyams_zmi.view import AdminView
 from pyramid.view import view_config
 from z3c.form import field
@@ -117,7 +118,7 @@
 #
 
 @adapter_config(name='connection', context=(ISite, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginConnectionAddForm(InnerAddForm):
+class LDAPPluginConnectionAddForm(InnerAdminAddForm):
     """LDAP plug-in add form connection"""
 
     id = 'ldap_connection_form'
@@ -129,7 +130,7 @@
 
 
 @adapter_config(name='users', context=(ISite, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginUsersAddForm(InnerAddForm):
+class LDAPPluginUsersAddForm(InnerAdminAddForm):
     """LDAP plug-in add form users schema"""
 
     id = 'ldap_users_form'
@@ -141,7 +142,7 @@
 
 
 @adapter_config(name='groups', context=(ISite, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginGroupsAddForm(InnerAddForm):
+class LDAPPluginGroupsAddForm(InnerAdminAddForm):
     """LDAP plug-in add form groups schema"""
 
     id = 'ldap_groups_form'
@@ -153,7 +154,7 @@
 
 
 @adapter_config(name='search', context=(ISite, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginSearchAddForm(InnerAddForm):
+class LDAPPluginSearchAddForm(InnerAdminAddForm):
     """LDAP plug-in add form search settings"""
 
     id = 'ldap_search_form'
@@ -161,6 +162,9 @@
     legend = None
     fields = field.Fields(ILDAPPlugin).select('users_select_query', 'users_search_query',
                                               'groups_select_query', 'groups_search_query')
+
+    label_css_class = 'control-label col-md-4'
+    input_css_class = 'col-md-8'
     weight = 4
 
 
@@ -209,7 +213,7 @@
 #
 
 @adapter_config(name='connection', context=(ILDAPPlugin, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginConnectionEditForm(InnerEditForm):
+class LDAPPluginConnectionEditForm(InnerAdminEditForm):
     """LDAP plug-in connection edit form"""
 
     id = 'ldap_connection_form'
@@ -221,7 +225,7 @@
 
 
 @adapter_config(name='users', context=(ILDAPPlugin, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginUsersEditForm(InnerEditForm):
+class LDAPPluginUsersEditForm(InnerAdminEditForm):
     """LDAP plug-in users schema edit form"""
 
     id = 'ldap_users_form'
@@ -233,7 +237,7 @@
 
 
 @adapter_config(name='groups', context=(ILDAPPlugin, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginGroupsEditForm(InnerEditForm):
+class LDAPPluginGroupsEditForm(InnerAdminEditForm):
     """LDAP plug-in groups schema edit form"""
 
     id = 'ldap_groups_form'
@@ -245,7 +249,7 @@
 
 
 @adapter_config(name='search', context=(ILDAPPlugin, IAdminLayer, ILDAPForm), provides=IInnerTabForm)
-class LDAPPluginSearchEditForm(InnerEditForm):
+class LDAPPluginSearchEditForm(InnerAdminEditForm):
     """LDAP plug-in search settings"""
 
     id = 'ldap_search_form'