From 37a748cbcc2f85e83211f0277b2a6721c2a54d29 Mon Sep 17 00:00:00 2001 From: tibing Date: Thu, 30 Jun 2016 11:25:49 +0300 Subject: [PATCH] feat(app\form inputs): add datepicker --- src/app/pages/form/inputs/inputs.html | 8 +++- .../widgets/datePickers/datePickers.html | 22 +++++++++ .../widgets/datePickers/datepickerCtrl.js | 20 +++++++++ .../datePickers/datepickerpopupCtrl.js | 26 +++++++++++ src/sass/theme/_datePicker.scss | 45 +++++++++++++++++++ 5 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 src/app/pages/form/inputs/widgets/datePickers/datePickers.html create mode 100644 src/app/pages/form/inputs/widgets/datePickers/datepickerCtrl.js create mode 100644 src/app/pages/form/inputs/widgets/datePickers/datepickerpopupCtrl.js create mode 100644 src/sass/theme/_datePicker.scss diff --git a/src/app/pages/form/inputs/inputs.html b/src/app/pages/form/inputs/inputs.html index 13bd46743..1a21c334a 100644 --- a/src/app/pages/form/inputs/inputs.html +++ b/src/app/pages/form/inputs/inputs.html @@ -34,6 +34,12 @@
+
+
+
@@ -55,8 +61,6 @@ ba-panel-class="with-scroll">
- - diff --git a/src/app/pages/form/inputs/widgets/datePickers/datePickers.html b/src/app/pages/form/inputs/widgets/datePickers/datePickers.html new file mode 100644 index 000000000..c7bf64745 --- /dev/null +++ b/src/app/pages/form/inputs/widgets/datePickers/datePickers.html @@ -0,0 +1,22 @@ +
+
+

Inline

+ +
+ +
+
+ +
+

Popup

+ +

+ + + + +

+ +
+ +
\ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/datePickers/datepickerCtrl.js b/src/app/pages/form/inputs/widgets/datePickers/datepickerCtrl.js new file mode 100644 index 000000000..61ba75e4f --- /dev/null +++ b/src/app/pages/form/inputs/widgets/datePickers/datepickerCtrl.js @@ -0,0 +1,20 @@ +/** + * Created by n.poltoratsky + * on 23.06.2016. + */ +(function(){ + 'use strict'; + + angular.module('BlurAdmin.pages.form') + .controller('datepickerCtrl', datepickerCtrl); + + /** @ngInject */ + function datepickerCtrl($scope) { + + $scope.dt = new Date(); + $scope.options = { + showWeeks: false + }; + + } +})(); \ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/datePickers/datepickerpopupCtrl.js b/src/app/pages/form/inputs/widgets/datePickers/datepickerpopupCtrl.js new file mode 100644 index 000000000..a3f71e207 --- /dev/null +++ b/src/app/pages/form/inputs/widgets/datePickers/datepickerpopupCtrl.js @@ -0,0 +1,26 @@ +/** + * Created by n.poltoratsky + * on 23.06.2016. + */ +(function(){ + 'use strict'; + + angular.module('BlurAdmin.pages.form') + .controller('datepickerpopupCtrl', datepickerpopupCtrl); + + /** @ngInject */ + function datepickerpopupCtrl($scope) { + + $scope.open = open; + $scope.opened = false; + $scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate']; + $scope.format = $scope.formats[0]; + $scope.options = { + showWeeks: false + }; + + function open() { + $scope.opened = true; + } + } +})(); \ No newline at end of file diff --git a/src/sass/theme/_datePicker.scss b/src/sass/theme/_datePicker.scss new file mode 100644 index 000000000..597ad84e1 --- /dev/null +++ b/src/sass/theme/_datePicker.scss @@ -0,0 +1,45 @@ +.datepicker { + .btn:hover { + transform: scale(1); + } + + button.btn.btn-default { + background-color: transparent; + } + + button.btn.btn-default.active { + background-color: $info; + color: white; + } + + button.btn.active span.ng-binding.text-info { + color: white; + } +} + +.uib-datepicker-wrap { + display:inline-block; + min-height:270px; +} + +.uib-datepicker span.ng-binding.text-muted { + color: $default-text; +} +.uib-datepicker-popup { + + background-color: $bootstrap-panel-bg; + border-width: 0; + color: black; + + button.btn { + color: black; + + .text-muted { + color: black; + } + } + + .glyphicon { + color: rgba($progress-background, 1); + } +} \ No newline at end of file