diff --git a/VERSION b/VERSION index dca86a8a..331892d6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.9.1-beta+timestamp.2014.02.23.23.32.02 +Version 2.9.1-beta+timestamp.2014.02.24.00.08.44 diff --git a/applications/welcome/static/css/bootstrap-theme.min.css b/applications/welcome/static/css/bootstrap-theme.min.css new file mode 100644 index 00000000..c7b6d39b --- /dev/null +++ b/applications/welcome/static/css/bootstrap-theme.min.css @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.0.3 (http://getbootstrap.com) + * Copyright 2013 Twitter, Inc. + * Licensed under http://www.apache.org/licenses/LICENSE-2.0 + */ + +.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);background-repeat:repeat-x;border-color:#2b669a;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff2d6ca2',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);background-repeat:repeat-x;border-color:#3e8f3e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff419641',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);background-repeat:repeat-x;border-color:#e38d13;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffeb9316',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);background-repeat:repeat-x;border-color:#b92c28;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc12e2a',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);background-repeat:repeat-x;border-color:#28a4c9;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2aabd2',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0)}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-color:#357ebd;background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff8f8f8',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb',endColorstr='#fff3f3f3',GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.075);box-shadow:inset 0 3px 9px rgba(0,0,0,0.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff282828',GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.25);box-shadow:inset 0 3px 9px rgba(0,0,0,0.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;border-color:#b2dba1;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffc8e5bc',GradientType=0)}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;border-color:#9acfea;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffb9def0',GradientType=0)}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;border-color:#f5e79e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fff8efc0',GradientType=0)}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;border-color:#dca7a7;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffe7c3c3',GradientType=0)}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb',endColorstr='#fff5f5f5',GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3071a9',GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff449d44',GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff31b0d5',GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffec971f',GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc9302c',GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;border-color:#3278b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3278b3',GradientType=0)}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffd0e9c6',GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffc4e3f3',GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fffaf2cc',GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffebcccc',GradientType=0)}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;border-color:#dcdcdc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8',endColorstr='#fff5f5f5',GradientType=0);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)} \ No newline at end of file diff --git a/applications/welcome/static/css/web2py-bootstrap3.css b/applications/welcome/static/css/web2py-bootstrap3.css new file mode 100644 index 00000000..846ce52f --- /dev/null +++ b/applications/welcome/static/css/web2py-bootstrap3.css @@ -0,0 +1,282 @@ +/*! + * part of the package to convert web2py elements to bootstrap3 theme + * Developed by Paolo Caruccio ( paolo.caruccio66@gmail.com ) + * Released under MIT license + * version 1 rev.201312222030 + * + * Supported version of bootstrap framework: 3.0.2+ + + * The full package includes: + * - bootstrap3.py python module + * - this css file + * - web2py-bootstrap3.js + * - example of layout.html + + */ + + +/*! + * rules overriding web2py.css + * remove if web2py.css is not used + +*/ + +div.flash.alert{ + background-image: none; + border-radius: 4px; + -o-border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-width: 1px; + color: rgb(51, 51, 51); + font-weight: normal; + margin: 0 0 20px 0; + min-width: 28px; + opacity: 1; + padding: 15px 35px 15px 15px; + vertical-align: baseline; + right: auto; } +div.flash.alert:hover { + opacity: 1; } +.ie-lte8 div.flash { + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } +.ie-lte8 div.flash:hover { + filter:alpha(opacity=100); } +ul.navbar-nav li { + margin-bottom: 0; } +ul.list-group, .bs3-form ul , ul.nav-tabs, ul.nav-pills { + margin-left: 0; } +p.lead { + text-align: inherit; } +.bs3-form label { + white-space: normal; } +.bs3-form.form-inline [type="text"], [type="password"], select { + margin-right: 0; } +.bs3-form div.error { + display: none; + width: auto; + background: transparent; + border: none; + color: #a94442; + padding: 0; + background-image: none; } + + +/*! + * bootstrap3 adapters + * essential rules + +*/ + +/* flash messages */ +div.flash.alert { + display: none; + position: fixed; + top: 70px; + cursor: pointer; + z-index: 1000000; + background-color: #f9edbe; + border-color: #f0c36d; } +div.flash.alert #closeflash { + display: inline-block; + position: relative; + top: -2px; + right: -21px; + color: inherit; + cursor: pointer; + opacity: 0.5; + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + text-shadow: 0 1px 0 #ffffff; + margin: 0; + padding: 0; } +/* buttons */ +.bs3-form-btn { + margin-top: 3px; + margin-bottom: 3px; } +/*image preview in update forms*/ +.w2p-uploaded-file .btn-group { + vertical-align: top; + margin-top: 0; } +#file-reset-btn { + vertical-align: top; } +.w2p-uploaded-file input[type="file"] { + display:inline-block; + padding-top: 7px; } +.w2p-file-preview img { + max-width: 150px; } +.w2p-file-preview:hover img { + background-color: #ebebeb; + border-color: #adadad; } +.w2p-file-preview span { + min-width: 150px; + max-width: 150px; + display: inline-block; + line-height: 40px; + min-height: 40px; } +#no-file { + display: inline-block; + background-color: #eee; + vertical-align: middle; + text-align: center; + border-radius: 4px; + min-width: 150px; + max-width: 150px; + line-height: 43px; + min-height: 43px; } +/* form-inline */ +.form-inline .form-group { + margin-right: 4px; } +/* list widget */ +.w2p_list li { + margin-bottom: 6px; } +.w2p_list li input { + display: inline-block; + width: 59%; + margin-right: 4px; } +/* autocomplete widget */ +div[id^=_autocomplete_] { + margin-top: -10px; + z-index: 1; } +select.autocomplete { + display: block; + padding: 6px 12px; + font-size: 14px; + line-height: 1.428571429; + color: #555; + vertical-align: middle; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-color: #428bca; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); + box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); + -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; } +/* nav-tabs */ +.nav-tabs { + margin-bottom: 15px; } +/* dropdown multilevels in menu*/ +/* fix issue when screen height is shorter than bs3 default */ +.navbar-collapse.short-screen { + max-height: 200px !important; } +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + margin-top: 5px; + margin-right: -10px; + border-style: solid; + /* right-arrow */ + border-color: transparent #cccccc; + border-width: 4px 0 4px 4px; } +@media (min-width: 768px) { + /* animation */ + .navbar-nav .dropdown-menu { + top: -9999px; + display: block; + opacity: 0; + -webkit-transition: opacity .4s ease-in-out; } + .dropdown-submenu { + position: relative; } + .dropdown-submenu>.dropdown-menu { + position: absolute; + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 4px 4px 4px; + /* animation */ + left: -9999px; + opacity: 0; + display: block; + -webkit-transition: opacity .4s ease-in-out; } + .navbar ul.nav li[data-w2pmenulevel="l0"]:hover >ul.dropdown-menu { + display: block; + /* animation */ + top: 100%; + opacity: 1; } + .dropdown-submenu:hover>.dropdown-menu { + display: block; + /* animation */ + left: 100%; + opacity: 1; } + .dropdown-submenu:hover>a, + .dropdown-submenu:focus>a { + color: #fff; + text-decoration: none; + background-color: #357ebd; } + .navbar-inverse .navbar-nav>li>a:hover, + .navbar-inverse .navbar-nav>li>a:focus, + .navbar-inverse .navbar-nav>li:hover>a { + color: #fff; + background-color: black; } + .dropdown-submenu>a:hover:after, + .dropdown-submenu:hover>a:after { + /* left-arrow */ + border-color: transparent #fff; + border-width: 4px 4px 4px 0; } +} +@media (max-width: 767px){ + .dropdown-menu { + width: 100%; + display: none; } + .dropdown-submenu>.dropdown-menu { + position: static; + float: none; + display: none; + border: none; + margin: 0; + padding: 0; + box-shadow: none; + text-indent: 8px; } + .dropdown-submenu>.dropdown-menu.open { + display: block; + height: 100%; } + .dropdown-submenu>a:after { + /* down-arrow */ + border-color: #cccccc transparent; + border-width: 4px 4px 0px 4px; } + .dropdown-submenu>a:hover:after { + border-color: #ffffff transparent; } + .dropdown-submenu>a.active { + font-weight: 700; } + .dropdown-submenu>a.active:after { + /* up-arrow */ + border-color: #ffffff transparent; + border-width: 0px 4px 4px 4px; } +} + + +/*! + * application customization + * add custom rules + +*/ + + +body { + padding-top: 70px; } +/* web2py logo */ +#web2py-logo { + color: #c6cecc; } +#web2py-logo b { + display: inline-block; + margin-top: -1px; } +#web2py-logo b>span { + font-size: 22px; + color: white; } +#web2py-logo:hover { + color: white; } +/*footer*/ +#footer>div.row { + padding-top: 9px; + margin: 20px 0 40px 0; + border-top: 1px solid #eee; } +#footer p { + margin-left: -15px; + margin-right: -15px; } diff --git a/applications/welcome/static/js/web2py-bootstrap3.js b/applications/welcome/static/js/web2py-bootstrap3.js new file mode 100644 index 00000000..8c741424 --- /dev/null +++ b/applications/welcome/static/js/web2py-bootstrap3.js @@ -0,0 +1,253 @@ +/*! + * part of the package to convert web2py elements to bootstrap3 theme + * Developed by Paolo Caruccio ( paolo.caruccio66@gmail.com ) + * Released under MIT license + * version 1 rev.201312222030 + * + * Supported version of bootstrap framework: 3.0.2+ + + * The full package includes: + * - bootstrap3.py python module + * - web2py-bootstrap3.css + * - this js file + * - example of layout.html + + */ + +(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; + + // functions + function menu_is_collapsed() { + return !$('.navbar-toggle').is(':hidden') + }; + + function closeSubmenu() { + $(".dropdown-submenu>a.active").each(function(){ + var o = $(this); + o.parent().children("ul").toggleClass('open').data('phase', null); + o.toggleClass('active'); + }); + }; + + $.fn.center = function (options) { + var defaults = {'parent': false, 'mode': "both"}; + var settings = $.extend(defaults, options); + var parent; + if (settings.parent) { + parent = this.parent(); + } else { + parent = window; + } + if (settings.mode != "horizontally") { + this.css("top", Math.max(0, (($(parent).height() - $(this).outerHeight()) / 2) + $(parent).scrollTop()) + "px");} + if (settings.mode != "vertically") { + this.css("left", Math.max(0, (($(parent).width() - $(this).outerWidth()) / 2) + $(parent).scrollLeft()) + "px");} + return this; + }; + + function adjust_maxheight_of_collapsed_nav() { + var cn = $('div.navbar-collapse'); + var sh = $(window).height(); + if (cn.get(0)) { + if (sh<320) { + cn.addClass('short-screen'); + } + else { + cn.removeClass('short-screen'); + } + } + }; + + // alert centering + $('.flash.alert').center({'mode': "horizontally"}); + + // navs + $(".nav ul.dropdown-menu").not("#w2p-auth-bar").each(function() { + var toggle = $(this).parent(); + if (toggle.parent().hasClass("nav")) { + toggle.attr("data-w2pmenulevel", "l0"); + toggle.children("a") + .addClass("dropdown-toggle") + .append(' ') + .attr("data-toggle", "dropdown"); + } else { + toggle.addClass("dropdown-submenu").removeClass("dropdown"); + }; + }); + + $('.navbar-nav a.dropdown-toggle').click(function(e) { + if (menu_is_collapsed()) { + e.preventDefault(); + }else{ + window.location=$(this).attr('href'); + }; + }); + + $(".dropdown-submenu>a").click(function(event) { + if (menu_is_collapsed()) { + event.preventDefault(); + event.stopPropagation(); + var submenu = $(this).parent().children("ul"); + submenu.data('phase','opening'); + var dropdownOfThis = $(this).parent().parent(); + var actives = dropdownOfThis.find('ul.dropdown-menu.open'); + if (actives && actives.length) { + var hasData = actives.data('phase'); + if (hasData && hasData=='opened') { + actives.removeClass('open'); + actives.siblings('a.active').removeClass('active'); + hasData || actives.data('phase', null); + }; + }; + submenu.toggleClass('open').data('phase','opened'); + $(this).toggleClass('active'); + }else{ + window.location=$(this).attr('href'); + }; + }); + + $(".nav-tabs .web2py-menu-active").addClass('active'); + $(".nav-tabs a").not(".dropdown-toggle").attr("data-toggle", "tab"); + + // form fixes + $(document).ready(function() { + $("form.bs3-form .w2p_list a").each(function() { + // the plus and minus buttons are generated by web2py.js + $(this).addClass('btn btn-default'); + }); + $("form.bs3-form p.w2p-autocomplete-widget").each(function() { + // not generated by formstyle + $(this).children('input').addClass('form-control'); + }); + $("form.bs3-form input[name='password_two']").each(function() { + // auth addition after form creation + var $this = $(this).addClass('form-control'); + var groupClass = 'form-group' + var labelClass = 'control-label'; + var commentClass = 'help-block'; + var comment; + var mode; + var hasError = false; + if ($this.parent().hasClass('form-horizontal')) { + mode = 'horizontal' + labelClass = fh_label_class+' control-label'; + }; + if ($this.parent().hasClass('form-inline')) { + mode = 'inline'; + labelClass = 'sr-only'; + commentClass = 'sr-only'; + var labelText = $this.prev('label').text(); + $this.attr("placeholder", labelText.slice(0,-2)); + }; + var error = $this.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 = $this[0].nextSibling.nodeValue; + if (text) { + comment = ""+text+""; + $this[0].parentNode.removeChild($this[0].nextSibling); + }; + }; + $this.prev('label').addClass(labelClass).andSelf().wrapAll("
"); + if (mode == 'horizontal') { + $this.wrap('
'); + }; + if (hasError) { + $this.parent().append(error); + }; + $this.parent().append(comment); + }); + $('form.bs3-form #auth_user_remember').each(function() { + // auth addition after form creation + var $input = $(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($('
')); + } else { + newGroup.wrap($('
')); + }; + }); + }); + + // form errors + $('form.bs3-form .error_wrapper').each(function() { + var $this = $(this) + var rcContainer = $this.parents('.rc_container'); + if (rcContainer.length > 0) { + $this.appendTo(rcContainer); + } + }); + $('form.bs3-form').find('div.error').addClass('text-danger').closest(".form-group").addClass('has-error'); + + // uploadwidget + $('#file-reset-btn').click(function() { + var el = $('div.w2p-uploaded-file')[0]; + var whatReset = jQuery.data(el, "reset"); + if (whatReset == "changed") { + $('.w2p-uploaded-file input[type="file"]') + .replaceWith( + $('.w2p-uploaded-file input[type="file"]') + .clone()); + $('.w2p-file-preview, .w2p-uploaded-file input[type="file"], #edit-btn-dd, #file-reset-btn').toggle(); + }else{ + $('.w2p-file-preview, #no-file, #edit-btn-dd, #file-reset-btn').toggle(); + $('div.w2p-uploaded-file').children('input[type=checkbox]').trigger('click'); + } + jQuery.removeData(el, "reset"); + }); + $('#change-file-option').click(function(e) { + e.preventDefault(); + $('.w2p-file-preview, .w2p-uploaded-file input[type="file"], #edit-btn-dd, #file-reset-btn').toggle(); + jQuery.data($('div.w2p-uploaded-file')[0], "reset", "changed"); + }); + $('#delete-file-option').click(function(e) { + e.preventDefault(); + var wimg = $('#image-thumb').outerWidth(), + himg = $('#image-thumb').outerHeight(); + $('#no-file') + .width(wimg) + .height(himg) + .css({'line-height':himg+'px'}); + $('.w2p-file-preview, #no-file, #edit-btn-dd, #file-reset-btn').toggle(); + $('div.w2p-uploaded-file').children('input[type=checkbox]').trigger('click'); + jQuery.data($('div.w2p-uploaded-file')[0], "reset", "deleted"); + }); + + // on page load + adjust_maxheight_of_collapsed_nav(); + + // resize and orientation change events + $(window).on('orientationchange resize', function(event) { + adjust_maxheight_of_collapsed_nav(); + $('.flash.alert').center({'mode':"horizontally"}); + if (menu_is_collapsed() === false) { + closeSubmenu(); + $('.navbar-nav .dropdown.open a.dropdown-toggle').dropdown('toggle'); + $('#main-menu.in, #login-menu.in').collapse('hide'); + }; + }); + +}(jQuery));