From 1c2ba8fc0616b3515ebe5bb95630371685173862 Mon Sep 17 00:00:00 2001 From: Vladimir Lugovsky Date: Wed, 23 Dec 2015 19:07:55 +0300 Subject: [PATCH] feat(panels): add panels page --- src/app/pages/dashboard/dashboard.html | 28 ++++++++--------- src/app/pages/pages.module.js | 1 + src/app/pages/panels/panels.module.js | 21 +++++++++++++ .../components/baPanel/baPanel.directive.js | 26 ++++++++++++++++ .../components/baPanel/baPanel.service.js | 30 +++++++++++++++++++ .../baPanel/baPanelSelf.directive.js | 26 ++++++++++++++++ .../blurPanel.directive.js | 2 +- .../{blurPanel => baPanel}/blurPanel.html | 0 8 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 src/app/pages/panels/panels.module.js create mode 100644 src/app/theme/components/baPanel/baPanel.directive.js create mode 100644 src/app/theme/components/baPanel/baPanel.service.js create mode 100644 src/app/theme/components/baPanel/baPanelSelf.directive.js rename src/app/theme/components/{blurPanel => baPanel}/blurPanel.directive.js (83%) rename src/app/theme/components/{blurPanel => baPanel}/blurPanel.html (100%) diff --git a/src/app/pages/dashboard/dashboard.html b/src/app/pages/dashboard/dashboard.html index bdde12d..316a178 100644 --- a/src/app/pages/dashboard/dashboard.html +++ b/src/app/pages/dashboard/dashboard.html @@ -1,30 +1,26 @@
-
- - - +
+
-
- - - +
+
-
- - - +
+
-
- - - +
+
diff --git a/src/app/pages/pages.module.js b/src/app/pages/pages.module.js index f80dc67..326453b 100644 --- a/src/app/pages/pages.module.js +++ b/src/app/pages/pages.module.js @@ -19,6 +19,7 @@ 'BlurAdmin.pages.maps', 'BlurAdmin.pages.modals', 'BlurAdmin.pages.notifications', + 'BlurAdmin.pages.panels', 'BlurAdmin.pages.profile', 'BlurAdmin.pages.progressBars', 'BlurAdmin.pages.slider', diff --git a/src/app/pages/panels/panels.module.js b/src/app/pages/panels/panels.module.js new file mode 100644 index 0000000..4606a4c --- /dev/null +++ b/src/app/pages/panels/panels.module.js @@ -0,0 +1,21 @@ +/** + * @author v.lugovsky + * created on 23.12.2015 + */ +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.panels', []) + .config(routeConfig); + + /** @ngInject */ + function routeConfig($stateProvider) { + $stateProvider + .state('panels', { + url: '/panels', + templateUrl: 'app/pages/panels/panels.html', + controller: 'NotificationsPageCtrl' + }); + } + +})(); diff --git a/src/app/theme/components/baPanel/baPanel.directive.js b/src/app/theme/components/baPanel/baPanel.directive.js new file mode 100644 index 0000000..77bc422 --- /dev/null +++ b/src/app/theme/components/baPanel/baPanel.directive.js @@ -0,0 +1,26 @@ +/** + * @author v.lugovsky + * created on 23.12.2015 + */ +(function () { + 'use strict'; + + /** + * Includes basic panel layout inside of current element. + */ + angular.module('BlurAdmin.theme') + .directive('baPanel', baPanel); + + /** @ngInject */ + function baPanel(baPanel) { + return angular.extend({}, baPanel, { + template: function(el, attrs) { + var res = ''; + return res; + } + }); + } + +})(); diff --git a/src/app/theme/components/baPanel/baPanel.service.js b/src/app/theme/components/baPanel/baPanel.service.js new file mode 100644 index 0000000..e5e4365 --- /dev/null +++ b/src/app/theme/components/baPanel/baPanel.service.js @@ -0,0 +1,30 @@ +/** + * @author v.lugovsky + * created on 23.12.2015 + */ +(function () { + 'use strict'; + + angular.module('BlurAdmin.theme') + .factory('baPanel', baPanel); + + /** @ngInject */ + function baPanel() { + + /** Base baPanel directive */ + return { + restrict: 'A', + transclude: true, + template: function(elem, attrs) { + var res = '
'; + if (attrs.baPanelTitle) { + var titleTpl = '

' + attrs.baPanelTitle + '

'; + res = titleTpl + res; // title should be before + } + + return res; + } + }; + } + +})(); diff --git a/src/app/theme/components/baPanel/baPanelSelf.directive.js b/src/app/theme/components/baPanel/baPanelSelf.directive.js new file mode 100644 index 0000000..4359e22 --- /dev/null +++ b/src/app/theme/components/baPanel/baPanelSelf.directive.js @@ -0,0 +1,26 @@ +/** + * @author v.lugovsky + * created on 23.12.2015 + */ +(function () { + 'use strict'; + + /** + * Represents current element as panel, adding all necessary classes. + */ + angular.module('BlurAdmin.theme') + .directive('baPanelSelf', baPanelSelf); + + /** @ngInject */ + function baPanelSelf(baPanel) { + return angular.extend({}, baPanel, { + link: function(scope, el, attrs) { + el.addClass('panel panel-default'); + if (attrs.baPanelClass) { + el.addClass(attrs.baPanelClass); + } + } + }); + } + +})(); diff --git a/src/app/theme/components/blurPanel/blurPanel.directive.js b/src/app/theme/components/baPanel/blurPanel.directive.js similarity index 83% rename from src/app/theme/components/blurPanel/blurPanel.directive.js rename to src/app/theme/components/baPanel/blurPanel.directive.js index ecc01de..b661443 100644 --- a/src/app/theme/components/blurPanel/blurPanel.directive.js +++ b/src/app/theme/components/baPanel/blurPanel.directive.js @@ -17,7 +17,7 @@ title: '@', classContainer: '@' }, - templateUrl: 'app/theme/components/blurPanel/blurPanel.html' + templateUrl: 'app/theme/components/baPanel/blurPanel.html' }; } diff --git a/src/app/theme/components/blurPanel/blurPanel.html b/src/app/theme/components/baPanel/blurPanel.html similarity index 100% rename from src/app/theme/components/blurPanel/blurPanel.html rename to src/app/theme/components/baPanel/blurPanel.html