fixed bootstrap class in SQLHTML, de ja vu

This commit is contained in:
Massimo
2013-01-08 11:45:04 -06:00
parent ec21e81f19
commit 3b56ed3cfd
4 changed files with 15 additions and 11 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2013.01.08.09.22.34 Version 2.4.1-alpha.2+timestamp.2013.01.08.11.35.00
+4
View File
@@ -1686,6 +1686,9 @@ SQLITE = set((
'WHERE', 'WHERE',
)) ))
MONGODB_NONRESERVED = set(('ID_', 'SAFE',))
# remove from here when you add a list. # remove from here when you add a list.
JDBCSQLITE = SQLITE JDBCSQLITE = SQLITE
DB2 = INFORMIX = INGRES = JDBCPOSTGRESQL = COMMON DB2 = INFORMIX = INGRES = JDBCPOSTGRESQL = COMMON
@@ -1708,6 +1711,7 @@ ADAPTERS = {
'jdbc:sqlite': JDBCSQLITE, 'jdbc:sqlite': JDBCSQLITE,
'jdbc:postgres': JDBCPOSTGRESQL, 'jdbc:postgres': JDBCPOSTGRESQL,
'common': COMMON, 'common': COMMON,
'mongodb_nonreserved': MONGODB_NONRESERVED
} }
ADAPTERS['all'] = reduce(lambda a, b: a.union(b), ( ADAPTERS['all'] = reduce(lambda a, b: a.union(b), (
+4 -4
View File
@@ -733,7 +733,7 @@ def formstyle_table2cols(form, fields):
def formstyle_divs(form, fields): def formstyle_divs(form, fields):
''' divs only ''' ''' divs only '''
table = TAG['']() table = FIELDSET()
for id, label, controls, help in fields: for id, label, controls, help in fields:
_help = DIV(help, _class='w2p_fc') _help = DIV(help, _class='w2p_fc')
_controls = DIV(controls, _class='w2p_fw') _controls = DIV(controls, _class='w2p_fw')
@@ -765,7 +765,7 @@ def formstyle_ul(form, fields):
def formstyle_bootstrap(form, fields): def formstyle_bootstrap(form, fields):
''' bootstrap format form layout ''' ''' bootstrap format form layout '''
form['_class'] = 'form-horizontal' form['_class'] += ' form-horizontal'
parent = FIELDSET() parent = FIELDSET()
for id, label, controls, help in fields: for id, label, controls, help in fields:
# wrappers # wrappers
@@ -799,12 +799,12 @@ def formstyle_bootstrap(form, fields):
if _submit: if _submit:
# submit button has unwrapped label and controls, different class # submit button has unwrapped label and controls, different class
parent.append(DIV(label, controls, _class='form-actions')) parent.append(DIV(label, controls, _class='form-actions', _id=id))
# unflag submit (possible side effect) # unflag submit (possible side effect)
_submit = False _submit = False
else: else:
# unwrapped label # unwrapped label
parent.append(DIV(label, _controls, _class='control-group')) parent.append(DIV(label, _controls, _class='control-group', _id=id))
return parent return parent
+6 -6
View File
@@ -3309,14 +3309,14 @@ class Auth(object):
restrict_search=False, restrict_search=False,
resolve=True, resolve=True,
extra=None, extra=None,
menugroups=None): menu_groups=None):
if not hasattr(self, '_wiki'): if not hasattr(self, '_wiki'):
self._wiki = Wiki(self, render=render, self._wiki = Wiki(self, render=render,
manage_permissions=manage_permissions, manage_permissions=manage_permissions,
force_prefix=force_prefix, force_prefix=force_prefix,
restrict_search=restrict_search, restrict_search=restrict_search,
env=env, extra=extra or {}, env=env, extra=extra or {},
menugroups=menugroups) menu_groups=menu_groups)
else: else:
self._wiki.env.update(env or {}) self._wiki.env.update(env or {})
# if resolve is set to True, process request as wiki call # if resolve is set to True, process request as wiki call
@@ -4726,7 +4726,7 @@ class Wiki(object):
def __init__(self, auth, env=None, render='markmin', def __init__(self, auth, env=None, render='markmin',
manage_permissions=False, force_prefix='', manage_permissions=False, force_prefix='',
restrict_search=False, extra=None, menugroups=None): restrict_search=False, extra=None, menu_groups=None):
self.env = env or {} self.env = env or {}
self.env['component'] = Wiki.component self.env['component'] = Wiki.component
if render == 'markmin': if render == 'markmin':
@@ -4735,7 +4735,7 @@ class Wiki(object):
render = self.html_render render = self.html_render
self.render = render self.render = render
self.auth = auth self.auth = auth
self.menugroups = menugroups self.menu_groups = menu_groups
if self.auth.user: if self.auth.user:
self.force_prefix = force_prefix % self.auth.user self.force_prefix = force_prefix % self.auth.user
else: else:
@@ -4853,11 +4853,11 @@ class Wiki(object):
return True return True
def can_see_menu(self): def can_see_menu(self):
if self.menugroups is None: if self.menu_groups is None:
return True return True
if self.auth.user: if self.auth.user:
groups = self.auth.user_groups.values() groups = self.auth.user_groups.values()
if any(t in self.menugroups for t in groups): if any(t in self.menu_groups for t in groups):
return True return True
return False return False