From 88dfd62aa539c5c2ad3e24be06c1ac7cffedd1a5 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 3 Jul 2014 14:10:09 +0200 Subject: [FIX] web: remove old datetimepicker and change by bootstrap datetimepicker --- .../src/less/bootstrap-datetimepicker-build.less | 5 + .../src/less/bootstrap-datetimepicker.less | 282 +++++++++++++++++++++ 2 files changed, 287 insertions(+) create mode 100644 addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less create mode 100755 addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less (limited to 'addons/web/static/lib/bootstrap-datetimepicker/src/less') diff --git a/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less new file mode 100644 index 00000000000..7f5288332e7 --- /dev/null +++ b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less @@ -0,0 +1,5 @@ +// Import boostrap variables including default color palette and fonts +@import "../bootstrap/variables.less"; + +// Import datepicker component +@import "bootstrap-datetimepicker.less"; diff --git a/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less new file mode 100755 index 00000000000..48e9f1215a3 --- /dev/null +++ b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less @@ -0,0 +1,282 @@ +/*! + * Datetimepicker for Bootstrap v3 + * https://github.com/Eonasdan/bootstrap-datetimepicker/ + */ +.bootstrap-datetimepicker-widget { + top: 0; + left: 0; + width: 250px; + padding: 4px; + margin-top: 1px; + z-index: 99999 !important; + border-radius: 4px; + + &.timepicker-sbs { + width: 600px; + } + + &.bottom { + &:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0,0,0,.2); + position: absolute; + top: -7px; + left: 7px; + } + + &:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid white; + position: absolute; + top: -6px; + left: 8px; + } + } + + &.top { + &:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-top: 7px solid #ccc; + border-top-color: rgba(0,0,0,.2); + position: absolute; + bottom: -7px; + left: 6px; + } + + &:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid white; + position: absolute; + bottom: -6px; + left: 7px; + } + } + + & .dow { + width: 14.2857%; + } + + &.pull-right { + &:before { + left: auto; + right: 6px; + } + + &:after { + left: auto; + right: 7px; + } + } + + >ul { + list-style-type: none; + margin: 0; + } + + a[data-action] { + padding: 6px 0; + } + + .timepicker-hour, .timepicker-minute, .timepicker-second { + width: 54px; + font-weight: bold; + font-size: 1.2em; + margin: 0; + } + + button[data-action] { + padding: 6px; + } + + table[data-hour-format="12"] .separator { + width: 4px; + padding: 0; + margin: 0; + } + + .datepicker > div { + display: none; + } + + .picker-switch { + text-align: center; + } + + table { + width: 100%; + margin: 0; + } + + td, + th { + text-align: center; + border-radius: 4px; + } + + td { + height: 54px; + line-height: 54px; + width: 54px; + + &.day + { + height: 20px; + line-height: 20px; + width: 20px; + } + + &.day:hover, + &.hour:hover, + &.minute:hover, + &.second:hover { + background: @gray-lighter; + cursor: pointer; + } + + &.old, + &.new { + color: @gray-light; + } + + &.today { + position: relative; + + &:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-bottom: 7px solid @btn-primary-bg; + border-top-color: rgba(0, 0, 0, 0.2); + position: absolute; + bottom: 4px; + right: 4px; + } + } + + &.active, + &.active:hover { + background-color: @btn-primary-bg; + color: #fff; + text-shadow: 0 -1px 0 rgba(0,0,0,.25); + } + + &.active.today:before { + border-bottom-color: #fff; + } + + &.disabled, + &.disabled:hover { + background: none; + color: @gray-light; + cursor: not-allowed; + } + + span { + display: block; + width: 54px; + height: 54px; + line-height: 54px; + float: left; + margin: 2px 1.5px; + cursor: pointer; + border-radius: 4px; + + &:hover { + background: @gray-lighter; + } + + &.active { + background-color: @btn-primary-bg; + color: #fff; + text-shadow: 0 -1px 0 rgba(0,0,0,.25); + } + + &.old { + color: @gray-light; + } + + &.disabled, + &.disabled:hover { + background: none; + color: @gray-light; + cursor: not-allowed; + } + } + } + + th { + height: 20px; + line-height: 20px; + width: 20px; + + &.switch { + width: 145px; + } + + &.next, + &.prev { + font-size: @font-size-base * 1.5; + } + + &.disabled, + &.disabled:hover { + background: none; + color: @gray-light; + cursor: not-allowed; + } + } + + thead tr:first-child th { + cursor: pointer; + + &:hover { + background: @gray-lighter; + } + } +} + +.input-group { + &.date { + .input-group-addon span { + display: block; + cursor: pointer; + width: 16px; + height: 16px; + } + } +} + +.bootstrap-datetimepicker-widget.left-oriented { + &:before { + left: auto; + right: 6px; + } + + &:after { + left: auto; + right: 7px; + } +} + +.bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td { + padding: 0px !important; +} + +@media screen and (max-width: 767px) { + .bootstrap-datetimepicker-widget.timepicker-sbs { + width: 283px; + } +} -- cgit v1.2.3 From 36146b3fadc47543f4b696ab75c31b3459afb15b Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 14 Aug 2014 14:10:40 +0200 Subject: [FIX] web: update moment and datepicker library also add a controller to lazily load locale --- .../src/less/bootstrap-datetimepicker-build.less | 2 +- .../src/less/bootstrap-datetimepicker.less | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'addons/web/static/lib/bootstrap-datetimepicker/src/less') diff --git a/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less index 7f5288332e7..4a17370153b 100644 --- a/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less +++ b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less @@ -1,5 +1,5 @@ // Import boostrap variables including default color palette and fonts -@import "../bootstrap/variables.less"; +@import "../../node_modules/bootstrap/less/variables.less"; // Import datepicker component @import "bootstrap-datetimepicker.less"; diff --git a/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less index 48e9f1215a3..49fbc15d300 100755 --- a/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less +++ b/addons/web/static/lib/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less @@ -1,5 +1,6 @@ /*! * Datetimepicker for Bootstrap v3 +//! version : 3.0.3 * https://github.com/Eonasdan/bootstrap-datetimepicker/ */ .bootstrap-datetimepicker-widget { @@ -9,7 +10,7 @@ padding: 4px; margin-top: 1px; z-index: 99999 !important; - border-radius: 4px; + border-radius: @border-radius-base; &.timepicker-sbs { width: 600px; @@ -123,7 +124,7 @@ td, th { text-align: center; - border-radius: 4px; + border-radius: @border-radius-base; } td { @@ -131,6 +132,14 @@ line-height: 54px; width: 54px; + &.cw + { + font-size: 10px; + height: 20px; + line-height: 20px; + color: @gray-light; + } + &.day { height: 20px; @@ -185,14 +194,13 @@ } span { - display: block; + display: inline-block; width: 54px; height: 54px; line-height: 54px; - float: left; margin: 2px 1.5px; cursor: pointer; - border-radius: 4px; + border-radius: @border-radius-base; &:hover { background: @gray-lighter; @@ -222,7 +230,7 @@ line-height: 20px; width: 20px; - &.switch { + &.picker-switch { width: 145px; } -- cgit v1.2.3