welcome more bootstrap3 compliant, thanks Paolo Caruccio

This commit is contained in:
mdipierro
2014-02-27 09:33:26 -06:00
parent 0d24d1e0d2
commit 1e9872c015
11 changed files with 64 additions and 37 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.9.1-beta+timestamp.2014.02.24.23.56.18 Version 2.9.1-beta+timestamp.2014.02.27.09.32.37
+2 -2
View File
@@ -75,8 +75,8 @@
* this over and over... all will be bound to the document * this over and over... all will be bound to the document
*/ */
/*adds btn class to buttons*/ /*adds btn class to buttons*/
$('button', target).addClass('btn'); $('button', target).addClass('btn').addClass('btn-default');
$('form input[type="submit"], form input[type="button"]', target).addClass('btn'); $('form input[type="submit"], form input[type="button"]', target).addClass('btn').addClass('btn-default');
/* javascript for PasswordWidget*/ /* javascript for PasswordWidget*/
$('input[type=password][data-w2p_entropy]', target).each(function () { $('input[type=password][data-w2p_entropy]', target).each(function () {
web2py.validate_entropy($(this)); web2py.validate_entropy($(this));
+2 -2
View File
@@ -75,8 +75,8 @@
* this over and over... all will be bound to the document * this over and over... all will be bound to the document
*/ */
/*adds btn class to buttons*/ /*adds btn class to buttons*/
$('button', target).addClass('btn'); $('button', target).addClass('btn').addClass('btn-default');
$('form input[type="submit"], form input[type="button"]', target).addClass('btn'); $('form input[type="submit"], form input[type="button"]', target).addClass('btn').addClass('btn-default');
/* javascript for PasswordWidget*/ /* javascript for PasswordWidget*/
$('input[type=password][data-w2p_entropy]', target).each(function () { $('input[type=password][data-w2p_entropy]', target).each(function () {
web2py.validate_entropy($(this)); web2py.validate_entropy($(this));
+2 -1
View File
@@ -6,7 +6,8 @@
######################################################################### #########################################################################
response.logo = A(B('web',SPAN(2),'py'),XML('™ '), response.logo = A(B('web',SPAN(2),'py'),XML('™ '),
_class="navbar-brand",_href="http://www.web2py.com/") _class="navbar-brand",_href="http://www.web2py.com/",
_id="web2py-logo")
response.title = request.application.replace('_',' ').title() response.title = request.application.replace('_',' ').title()
response.subtitle = '' response.subtitle = ''
@@ -2,7 +2,7 @@
* part of the package to convert web2py elements to bootstrap3 theme * part of the package to convert web2py elements to bootstrap3 theme
* Developed by Paolo Caruccio ( paolo.caruccio66@gmail.com ) * Developed by Paolo Caruccio ( paolo.caruccio66@gmail.com )
* Released under MIT license * Released under MIT license
* version 1 rev.201312222030 * version 1 rev.201402261600
* *
* Supported version of bootstrap framework: 3.0.2+ * Supported version of bootstrap framework: 3.0.2+
@@ -73,10 +73,16 @@ div.flash.alert {
display: none; display: none;
position: fixed; position: fixed;
top: 70px; top: 70px;
right: 75px;
cursor: pointer; cursor: pointer;
z-index: 1000000; z-index: 1000000;
background-color: #f9edbe; background-color: #f9edbe;
border-color: #f0c36d; } border-color: #f0c36d; }
div.flash.alert.centered {
right: auto; }
div.flash.alert.leftside {
right: auto;
left: 75px; }
div.flash.alert #closeflash { div.flash.alert #closeflash {
display: inline-block; display: inline-block;
position: relative; position: relative;
@@ -280,3 +286,6 @@ body {
#footer p { #footer p {
margin-left: -15px; margin-left: -15px;
margin-right: -15px; } margin-right: -15px; }
.dropdown .highlighted {
color: #428bca;
}
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
* part of the package to convert web2py elements to bootstrap3 theme * part of the package to convert web2py elements to bootstrap3 theme
* Developed by Paolo Caruccio ( paolo.caruccio66@gmail.com ) * Developed by Paolo Caruccio ( paolo.caruccio66@gmail.com )
* Released under MIT license * Released under MIT license
* version 1 rev.201312222030 * version 1 rev.201402261600
* *
* Supported version of bootstrap framework: 3.0.2+ * Supported version of bootstrap framework: 3.0.2+
@@ -69,7 +69,7 @@
}; };
// alert centering // alert centering
$('.flash.alert').center({'mode': "horizontally"}); $('.flash.alert.centered').center({'mode': "horizontally"});
// navs // navs
$(".nav ul.dropdown-menu").not("#w2p-auth-bar").each(function() { $(".nav ul.dropdown-menu").not("#w2p-auth-bar").each(function() {
@@ -139,7 +139,7 @@
var mode; var mode;
var hasError = false; var hasError = false;
if ($this.parent().hasClass('form-horizontal')) { if ($this.parent().hasClass('form-horizontal')) {
mode = 'horizontal' mode = 'horizontal';
labelClass = fh_label_class+' control-label'; labelClass = fh_label_class+' control-label';
}; };
if ($this.parent().hasClass('form-inline')) { if ($this.parent().hasClass('form-inline')) {
+2 -2
View File
@@ -75,8 +75,8 @@
* this over and over... all will be bound to the document * this over and over... all will be bound to the document
*/ */
/*adds btn class to buttons*/ /*adds btn class to buttons*/
$('button', target).addClass('btn'); $('button', target).addClass('btn').addClass('btn-default');
$('form input[type="submit"], form input[type="button"]', target).addClass('btn'); $('form input[type="submit"], form input[type="button"]', target).addClass('btn').addClass('btn-default');
/* javascript for PasswordWidget*/ /* javascript for PasswordWidget*/
$('input[type=password][data-w2p_entropy]', target).each(function () { $('input[type=password][data-w2p_entropy]', target).each(function () {
web2py.validate_entropy($(this)); web2py.validate_entropy($(this));
+24 -15
View File
@@ -1,25 +1,34 @@
{{extend 'layout.html'}} {{extend 'layout.html'}}
<h2>{{=T( request.args(0).replace('_',' ').capitalize() )}}</h2> <h2>{{=T( request.args(0).replace('_',' ').capitalize() )}}</h2>
<div id="web2py_user_form">
{{ <div class="container">
if request.args(0)=='login': <div class="row">
if not 'register' in auth.settings.actions_disabled: <div id="web2py_user_form" class="col-lg-6">
form.add_button(T('Register'),URL(args='register', vars={'_next': request.vars._next} if request.vars._next else None),_class='btn') {{
pass if request.args(0)=='login':
if not 'request_reset_password' in auth.settings.actions_disabled: if not 'register' in auth.settings.actions_disabled:
form.add_button(T('Lost Password'),URL(args='request_reset_password'),_class='btn') form.add_button(T('Register'),URL(args='register', vars={'_next': request.vars._next} if request.vars._next else None),_class='btn btn-default')
pass pass
pass if not 'request_reset_password' in auth.settings.actions_disabled:
=form form.add_button(T('Lost Password'),URL(args='request_reset_password'),_class='btn btn-default')
}} pass
pass
=form
}}
</div>
</div>
</div> </div>
<script language="javascript"><!--
jQuery("#web2py_user_form input:visible:enabled:first").focus();
{{block page_js}}
<script>
jQuery("#web2py_user_form input:visible:enabled:first").focus();
{{if request.args(0)=='register':}} {{if request.args(0)=='register':}}
web2py_validate_entropy(jQuery('#auth_user_password'),100); web2py_validate_entropy(jQuery('#auth_user_password'),100);
{{elif request.args(0)=='change_password':}} {{elif request.args(0)=='change_password':}}
web2py_validate_entropy(jQuery('#no_table_new_password'),100); web2py_validate_entropy(jQuery('#no_table_new_password'),100);
{{pass}} {{pass}}
//--></script> </script>
{{end page_js}}
+9 -6
View File
@@ -29,17 +29,20 @@
{{ {{
response.files.insert(0,URL('static','css/web2py.css')) response.files.insert(0,URL('static','css/web2py.css'))
response.files.insert(1,URL('static','css/bootstrap.min.css')) response.files.insert(1,URL('static','css/bootstrap.min.css'))
response.files.insert(2,URL('static','css/web2py-bootstrap3.css')) response.files.insert(3,URL('static','css/bootstrap-theme.min.css'))
response.files.insert(4,URL('static','css/web2py-bootstrap3.css'))
}} }}
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script> --> <!-- All JavaScript at the bottom, except for Modernizr which enables
<!--[if lt IE 9]> HTML5 elements & feature detects -->
<script src="{{=URL('static','js/respond.min.js')}}"></script> <script src="{{=URL('static','js/modernizr.custom.js')}}"></script>
<![endif]-->
<!-- Favicons --> <!-- Favicons -->
<link rel="shortcut icon" href="{{=URL('static','images/favicon.ico')}}" type="image/x-icon"> <link rel="shortcut icon" href="{{=URL('static','images/favicon.ico')}}" type="image/x-icon">
<link rel="apple-touch-icon" href="{{=URL('static','images/favicon.png')}}"> <link rel="apple-touch-icon" href="{{=URL('static','images/favicon.png')}}">
{{include 'web2py_ajax.html'}} {{include 'web2py_ajax.html'}}
{{block head}}{{end}} {{block head}}{{end}}
<!--[if lt IE 9]>
<script src="{{=URL('static','js/respond.min.js')}}"></script>
<![endif]-->
{{ {{
# using sidebars need to know what sidebar you want to use # using sidebars need to know what sidebar you want to use
mc0 = 'col-md-12' mc0 = 'col-md-12'
@@ -52,7 +55,7 @@
}} }}
</head> </head>
<body> <body>
<div class="flash alert alert-dismissable">{{=response.flash or ''}}</div> <div class="flash alert centered alert-dismissable">{{=response.flash or ''}}</div>
<!-- Navbar =================================================================== --> <!-- Navbar =================================================================== -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container"> <div class="container">
+5 -4
View File
@@ -2222,11 +2222,12 @@ class FORM(DIV):
REDIRECT_JS = "window.location='%s';return false" REDIRECT_JS = "window.location='%s';return false"
def add_button(self, value, url, _class=None): def add_button(self, value, url, _class=None):
submit = self.element('input[type=submit]') submit = self.element(_type='submit')
_class = "%s w2p-form-button" % _class if _class else "w2p-form-button"
submit.parent.append( submit.parent.append(
INPUT(_type="button", _value=value, _class=_class, TAG['button'](value, _class=_class,
_onclick=url if url.startswith('javascript:') else _onclick=url if url.startswith('javascript:') else
self.REDIRECT_JS % url)) self.REDIRECT_JS % url))
@staticmethod @staticmethod
def confirm(text='OK', buttons=None, hidden=None): def confirm(text='OK', buttons=None, hidden=None):