From e04d16bdc1ec48de0c3a71d0806edbc93eaa2a13 Mon Sep 17 00:00:00 2001 From: jvanbraekel Date: Wed, 22 Aug 2018 17:21:31 +0200 Subject: [PATCH] Align SQLForm.grid selec action left and insure compatibility with bootsrap 4 --- applications/welcome/static/css/web2py-bootstrap4.css | 10 ++++++++++ gluon/sqlhtml.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/applications/welcome/static/css/web2py-bootstrap4.css b/applications/welcome/static/css/web2py-bootstrap4.css index 2586fe99..2a8348c9 100644 --- a/applications/welcome/static/css/web2py-bootstrap4.css +++ b/applications/welcome/static/css/web2py-bootstrap4.css @@ -348,3 +348,13 @@ td.w2p_fc, .icon.pen:before { content: "\f040";} .icon.arrowright:before { content: "\f061";} .icon.magnifier:before { content: "\f002";} + +.web2py_table_selectable_actions { + padding-top: 10px; + float: right; +} + +.web2py_table_selectable_actions input { + padding: 5px 7px; + margin-right: 10px; +} diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index cfdf88ce..dd9e7349 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -3087,8 +3087,9 @@ class SQLFORM(FORM): if formstyle == 'bootstrap': # add space between buttons - # inputs = sum([[inp, ' '] for inp in inputs], [])[:-1] htmltable = FORM(htmltable, DIV(_class='form-actions', *inputs)) + elif 'bootstrap' in formstyle : # Same for bootstrap 3 & 4 + htmltable = FORM(htmltable, DIV(_class='form-group web2py_table_selectable_actions', *inputs)) else: htmltable = FORM(htmltable, *inputs)