diff --git a/applications/welcome3/controllers/test.py b/applications/welcome3/controllers/test.py index 65b49b39..82a6bedb 100644 --- a/applications/welcome3/controllers/test.py +++ b/applications/welcome3/controllers/test.py @@ -1,7 +1,7 @@ def index(): types = ['string','text','date','time','datetime','integer','double', - 'list:string','list:integer'] - db.define_table('mytable',*[Field('f_'+t.replace(':','_'),t) for t in types]) + 'list:string','list:integer','upload'] + db.define_table('mytable',*[Field('f_'+t.replace(':','_'),t,requires=IS_NOT_EMPTY()) for t in types]) return dict( form = SQLFORM(db.mytable).process(), grid = SQLFORM.grid(db.mytable), diff --git a/applications/welcome3/databases/sql.log b/applications/welcome3/databases/sql.log index 0d964f10..c3235b01 100644 --- a/applications/welcome3/databases/sql.log +++ b/applications/welcome3/databases/sql.log @@ -80,3 +80,6 @@ CREATE TABLE mytable( f_list_integer TEXT ); success! +timestamp: 2015-03-10T23:02:09.466071 +ALTER TABLE mytable ADD f_upload CHAR(512); +success! diff --git a/applications/welcome3/databases/storage.sqlite b/applications/welcome3/databases/storage.sqlite index 96827200..1692c2c7 100644 Binary files a/applications/welcome3/databases/storage.sqlite and b/applications/welcome3/databases/storage.sqlite differ diff --git a/applications/welcome3/static/css/web2py-bootstrap3.css b/applications/welcome3/static/css/web2py-bootstrap3.css index 2e18330c..93229240 100644 --- a/applications/welcome3/static/css/web2py-bootstrap3.css +++ b/applications/welcome3/static/css/web2py-bootstrap3.css @@ -289,3 +289,8 @@ body { .dropdown .highlighted { color: #428bca; } + +ul.w2p_list { margin-left: 0px; } +input.date,input.time,input.datetime,input.double,input.integer { width: 33.333%; } + + diff --git a/applications/welcome3/static/js/web2py-bootstrap3.js b/applications/welcome3/static/js/web2py-bootstrap3.js index 813fc375..31dc1617 100644 --- a/applications/welcome3/static/js/web2py-bootstrap3.js +++ b/applications/welcome3/static/js/web2py-bootstrap3.js @@ -15,15 +15,10 @@ */ jQuery(function(){ - // bootstrap3 classes for elements of horizontal form - data - var FH_CL_PREFIX = 'col-md-', // class prefix - FH_LABEL_COLW = '4', // nr. of columns of 12 - FH_CONTROL_COLW = '8'; // 12 - FH_LABEL_COLW; - // bootstrap3 classes for elements of horizontal form - calculations - var fh_label_class = FH_CL_PREFIX + FH_LABEL_COLW, - fh_offest_class = FH_CL_PREFIX+'offset-'+FH_LABEL_COLW, - fh_control_class = FH_CL_PREFIX + FH_CONTROL_COLW; + var fh_label_class = 'col-md-4', + fh_offest_class = 'col-md-offset-4', + fh_control_class = 'col-md-8'; // functions function menu_is_collapsed() { @@ -58,17 +53,6 @@ jQuery(function(){ return this; }; - function adjust_maxheight_of_collapsed_nav() { - var cn = jQuery('div.navbar-collapse'); - var sh = jQuery(window).height(); - if (cn.get(0)) { - if (sh<320) - cn.addClass('short-screen'); - else if(cn.hasClass('short-screen')) - cn.removeClass('short-screen'); - } - }; - // alert centering jQuery('.flash.alert.centered').center({'mode': "horizontally"}); @@ -118,116 +102,23 @@ jQuery(function(){ jQuery(".nav-tabs .web2py-menu-active").addClass('active'); jQuery(".nav-tabs a").not(".dropdown-toggle").attr("data-toggle", "tab"); - + // button fixes + jQuery("button:not(.btn),input[type=button]:not(.btn),.w2p_list a").addClass('btn btn-default'); // form fixes - jQuery("ul.w2p_list").css('margin-left',0); - jQuery("ul.w2p_list input").addClass('form-control'); - jQuery("input.date,input.time,input.datetime,input.double,input.integer").css('width','33.33333333%'); - // the plus and minus buttons are generated by web2py.js - jQuery("form.bs3-form .w2p_list a").addClass('btn btn-default'); - // not generated by formstyle jQuery("form.bs3-form p.w2p-autocomplete-widget input").addClass('form-control'); - jQuery("form.bs3-form input[name='password_two']").each(function() { - // auth addition after form creation - var self = jQuery(this).addClass('form-control'); - var groupClass = 'form-group'; - var labelClass = 'control-label'; - var commentClass = 'help-block'; - var comment; - var mode; - var hasError = false; - if (self.parent().hasClass('form-horizontal')) { - mode = 'horizontal'; - labelClass = fh_label_class+' control-label'; - }; - if (self.parent().hasClass('form-inline')) { - mode = 'inline'; - labelClass = 'sr-only'; - commentClass = 'sr-only'; - var labelText = self.prev('label').text(); - self.attr("placeholder", labelText.slice(0,-2)); - }; - var error = self.next('div.error_wrapper'); - if (error.length > 0) { - var hasError = true; - groupClass = 'form-group has-error' - var text = error[0].nextSibling.nodeValue; - if (text) { - comment = ""+text+""; - error[0].parentNode.removeChild(error[0].nextSibling); - }; - } else { - var text = self[0].nextSibling.nodeValue; - if (text) { - comment = ""+text+""; - self[0].parentNode.removeChild(self[0].nextSibling); - }; - }; - self.prev('label').addClass(labelClass).andSelf().wrapAll("
"); - if (mode == 'horizontal') { - self.wrap(''); - }; - if (hasError) { - self.parent().append(error); - }; - self.parent().append(comment); - }); - jQuery('form.bs3-form #auth_user_remember').each(function() { - // auth addition after form creation - var $input = jQuery(this); - var $label = $input.next('label'); - var $iParent = $input.parent(); - $input.removeClass('checkbox'); - $iParent.prev('label').remove(); - $input.prependTo($label); - var newGroup = $label; - $iParent.replaceWith(newGroup); - if (newGroup.parent().hasClass('form-horizontal')) { - newGroup.wrap(jQuery('