From 292a71e8bb5e3f4c1863fe8a381a6b82ff5072a0 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 8 Jan 2013 09:31:18 -0600 Subject: [PATCH] fixed issue 1229, _class and bootstrap in SQLFORM, thanks Paolo Valleri --- VERSION | 2 +- gluon/sqlhtml.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 23f15a0d..17ca8a9f 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 36082b34..7f710e51 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -733,7 +733,7 @@ def formstyle_table2cols(form, fields): def formstyle_divs(form, fields): ''' divs only ''' - table = TAG['']() + table = FIELDSET() for id, label, controls, help in fields: _help = DIV(help, _class='w2p_fc') _controls = DIV(controls, _class='w2p_fw') @@ -765,7 +765,7 @@ def formstyle_ul(form, fields): def formstyle_bootstrap(form, fields): ''' bootstrap format form layout ''' - form['_class'] = 'form-horizontal' + form['_class'] += ' form-horizontal' parent = FIELDSET() for id, label, controls, help in fields: # wrappers @@ -799,12 +799,12 @@ def formstyle_bootstrap(form, fields): if _submit: # 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) _submit = False else: # unwrapped label - parent.append(DIV(label, _controls, _class='control-group')) + parent.append(DIV(label, _controls, _class='control-group', _id=id)) return parent