welcome more bootstrap3 compliant, thanks Paolo Caruccio
This commit is contained in:
1 parent
0d24d1e0d2
commit
1e9872c015
11 files changed
+58
-31
No files matched your search
@@ -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
|
||||||
@@ -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));
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/* Modernizr 2.7.1 (Custom Build) | MIT & BSD
|
||||||
|
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
|
||||||
|
*/
|
||||||
|
;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.7.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return I("flexWrap")},s.flexboxlegacy=function(){return I("boxDirection")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!I("indexedDB",a)},s.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},s.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},s.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return I("backgroundSize")},s.borderimage=function(){return I("borderImage")},s.borderradius=function(){return I("borderRadius")},s.boxshadow=function(){return I("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return D("opacity:.55"),/^Line truncated
|
||||||
@@ -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')) {
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -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">
|
||||||
|
<div id="web2py_user_form" class="col-lg-6">
|
||||||
|
{{
|
||||||
|
if request.args(0)=='login':
|
||||||
if not 'register' in auth.settings.actions_disabled:
|
if not 'register' in auth.settings.actions_disabled:
|
||||||
form.add_button(T('Register'),URL(args='register', vars={'_next': request.vars._next} if request.vars._next else None),_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
|
||||||
if not 'request_reset_password' in auth.settings.actions_disabled:
|
if not 'request_reset_password' in auth.settings.actions_disabled:
|
||||||
form.add_button(T('Lost Password'),URL(args='request_reset_password'),_class='btn')
|
form.add_button(T('Lost Password'),URL(args='request_reset_password'),_class='btn btn-default')
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
=form
|
=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}}
|
||||||
|
|
||||||
@@ -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">
|
||||||
|
|||||||
+3
-2
@@ -2222,9 +2222,10 @@ 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))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user