fixed issue 1229, _class and bootstrap in SQLFORM, thanks Paolo Valleri
This commit is contained in:
@@ -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.09.30.18
|
||||||
|
|||||||
+4
-4
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user