diff --git a/bower.json b/bower.json index b45aa79..d5ded89 100644 --- a/bower.json +++ b/bower.json @@ -47,12 +47,12 @@ "angular-chart.js": "~0.8.8", "angular-chartist.js": "~3.3.12", "angular-morris-chart": "~1.1.0", - "angular-ui-tree": "~2.12.0", "ionrangeslider": "~2.1.2", "angular-bootstrap": "~0.14.3", "angular-animate": "~1.4.8", "textAngular": "~1.4.6", - "angular-xeditable": "~0.1.9" + "angular-xeditable": "~0.1.9", + "ng-js-tree": "~0.0.7" }, "overrides": { "amcharts": { diff --git a/src/app/app.js b/src/app/app.js index ae76807..7229532 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -10,6 +10,7 @@ angular.module('BlurAdmin', [ 'smart-table', "xeditable", 'ui.slimscroll', + 'ngJsTree', 'BlurAdmin.theme', 'BlurAdmin.pages', diff --git a/src/app/pages/dashboard/timeline/timeline.html b/src/app/pages/dashboard/timeline/timeline.html deleted file mode 100644 index e415b07..0000000 --- a/src/app/pages/dashboard/timeline/timeline.html +++ /dev/null @@ -1,43 +0,0 @@ - -
-
-
- Picture -
- -
-
Title of section 1
- -

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi - placeat iure tempora laudantium ipsa ad debitis unde? Iste voluptatibus minus veritatis qui ut.

- Jan 14 -
-
- -
-
- Movie -
- -
-
Title of section 2
- -

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi - placeat iure tempora laudantium ipsa ad debitis unde?

- Jan 18 -
-
- -
-
- Location -
- -
-
Title of section 3
- -

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum.

- Feb 18 -
-
-
\ No newline at end of file diff --git a/src/app/pages/form/inputs/widgets/switch/switch.directive.js b/src/app/pages/form/inputs/widgets/switch/switch.directive.js index 19af514..7817b59 100644 --- a/src/app/pages/form/inputs/widgets/switch/switch.directive.js +++ b/src/app/pages/form/inputs/widgets/switch/switch.directive.js @@ -6,7 +6,7 @@ 'use strict'; angular.module('BlurAdmin.pages.form') - .service('switch', switchDirective); + .directive('switch', switchDirective); /** @ngInject */ function switchDirective($timeout) { diff --git a/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.directive.js b/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.directive.js index cdb1e97..8bd8417 100644 --- a/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.directive.js +++ b/src/app/pages/form/inputs/widgets/tagsInput/tagsInput.directive.js @@ -6,10 +6,10 @@ 'use strict'; angular.module('BlurAdmin.pages.form') - .service('tagsInput', tagsInput); + .directive('tagInput', tagInput); /** @ngInject */ - function tagsInput() { + function tagInput() { return { restrict: 'A', link: function( $scope, elem, attr) { diff --git a/src/app/pages/pages.module.js b/src/app/pages/pages.module.js index 79fa154..ca34d20 100644 --- a/src/app/pages/pages.module.js +++ b/src/app/pages/pages.module.js @@ -28,6 +28,7 @@ 'BlurAdmin.pages.tabs', 'BlurAdmin.pages.typography', 'BlurAdmin.pages.ui', + 'BlurAdmin.pages.timeline', ]) .config(routeConfig); diff --git a/src/app/pages/tables/basic/tables.html b/src/app/pages/tables/basic/tables.html index c57d68b..bf6e44e 100644 --- a/src/app/pages/tables/basic/tables.html +++ b/src/app/pages/tables/basic/tables.html @@ -31,7 +31,7 @@
-
+
diff --git a/src/app/pages/tables/tables.html b/src/app/pages/tables/tables.html deleted file mode 100644 index db58c7b..0000000 --- a/src/app/pages/tables/tables.html +++ /dev/null @@ -1,44 +0,0 @@ -
- -
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - -
\ No newline at end of file diff --git a/src/app/pages/dashboard/timeline/TimelineCtrl.js b/src/app/pages/timeline/TimelineCtrl.js similarity index 92% rename from src/app/pages/dashboard/timeline/TimelineCtrl.js rename to src/app/pages/timeline/TimelineCtrl.js index c55eb6a..4729b93 100644 --- a/src/app/pages/dashboard/timeline/TimelineCtrl.js +++ b/src/app/pages/timeline/TimelineCtrl.js @@ -5,8 +5,8 @@ (function () { 'use strict'; - angular.module('BlurAdmin.pages.dashboard') - .service('TimelineCtrl', TimelineCtrl); + angular.module('BlurAdmin.pages.timeline') + .controller('TimelineCtrl', TimelineCtrl); /** @ngInject */ function TimelineCtrl() { diff --git a/src/app/pages/timeline/timeline.html b/src/app/pages/timeline/timeline.html new file mode 100644 index 0000000..6203d51 --- /dev/null +++ b/src/app/pages/timeline/timeline.html @@ -0,0 +1,101 @@ + +
+
+
+
+
+
+ +
+
Title of section 1
+ +

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi + placeat iure tempora laudantium ipsa ad debitis unde? Iste voluptatibus minus veritatis qui ut.

+ Jan 14 +
+
+ +
+
+
+
+ +
+
Title of section 2
+ +

Donec dapibus at leo eget volutpat. Praesent dolor tellus, ultricies venenatis molestie eu, luctus eget nibh. + Curabitur ullamcorper eleifend nisl.

+ Jan 18 +
+
+ +
+
+
+
+ +
+
Title of section 3
+ +

Phasellus auctor tellus eget lacinia condimentum. Cum sociis natoque penatibus et magnis dis parturient + montes.

+ Feb 18 +
+
+ +
+
+
+
+ +
+
Title of section 4
+ +

Morbi fringilla in massa ac posuere. Fusce non sagittis massa, id accumsan odio. Nullam eget tempor est. + Etiam eu felis eu purus aliquam tristique id quis nisl. Nam eros nibh, consequat sed pulvinar eu, ultrices + ornare ligula. Aenean interdum sed nunc sed hendrerit.

+ Feb 20 +
+
+
+
+
+
+ +
+
Title of section 5
+ +

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur eget mattis + metus. Nullam egestas eros metus, quis fringilla urna accumsan sed. Aliquam ultrices at arcu vitae + tincidunt.

+ Feb 21 +
+
+
+
+
+
+ +
+
Title of section 6
+ +

Praesent bibendum ante mattis augue consectetur, ut commodo turpis consequat. Donec ligula eros, porta in + iaculis vel, semper ac sem. Integer at mauris lorem.

+ Feb 23 +
+
+
+
+
+
+ +
+
Title of section 7
+ +

Vivamus ut laoreet erat, vitae eleifend eros. Sed varius id tellus non lobortis. Sed dolor ante, cursus non + scelerisque sed, euismod id eros.

+ Feb 24 +
+
+
+
\ No newline at end of file diff --git a/src/app/pages/timeline/timeline.module.js b/src/app/pages/timeline/timeline.module.js new file mode 100644 index 0000000..5fa61f5 --- /dev/null +++ b/src/app/pages/timeline/timeline.module.js @@ -0,0 +1,19 @@ +/** + * @author a.demeshko + * created on 1/12/16 + */ +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.timeline', []) + .config(routeConfig); + + /** @ngInject */ + function routeConfig($stateProvider) { + $stateProvider + .state('timeline', { + url: '/timeline', + templateUrl: 'app/pages/timeline/timeline.html' + }); + } +})(); \ No newline at end of file diff --git a/src/app/pages/tree/tree.html b/src/app/pages/tree/tree.html index 9e99418..9faf283 100644 --- a/src/app/pages/tree/tree.html +++ b/src/app/pages/tree/tree.html @@ -1,72 +1,39 @@ -
- - - - -
-
-
-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - -
-
+
+
+
+
+
+
+
+
-
-
-
-
    -
  1. -
+
+ +
+
+ +
+
+ +
+
+
+ + +
-
-
-
-
-
-
    -
  1. -
+
+
+
+
+
+
- -
\ No newline at end of file +
+
diff --git a/src/app/pages/tree/treeCtrl.js b/src/app/pages/tree/treeCtrl.js index 84bc272..cca076a 100644 --- a/src/app/pages/tree/treeCtrl.js +++ b/src/app/pages/tree/treeCtrl.js @@ -11,239 +11,377 @@ /** @ngInject */ function treeCtrl($scope, $timeout) { - var getRootNodesScope = function () { - return angular.element(document.getElementById('tree-root')).scope(); + $scope.ignoreChanges = false; + var newId = 0; + $scope.ignoreChanges = false; + $scope.newNode = {}; + + $scope.basicConfig = { + core: { + multiple: false, + check_callback: true, + worker: true + }, + 'types': { + 'folder': { + 'icon': 'ion-ios-folder' + }, + 'default': { + 'icon': 'ion-document-text' + } + }, + 'plugins': ['types'], + 'version': 1 }; - var getFirstNode = function () { - return angular.element(document.getElementsByClassName("tree-node")[0]).scope(); + $scope.dragConfig = { + 'core': { + 'check_callback': true, + 'themes': { + 'responsive': false + } + }, + 'types': { + 'folder': { + 'icon': 'ion-ios-folder' + }, + 'default': { + 'icon': 'ion-document-text' + } + }, + "plugins": ["dnd", 'types'] }; - $scope.select = function (item) { - $scope.current.selected = false; - $scope.current = item; - $scope.current.selected = true; + $scope.addNewNode = function () { + $scope.ignoreChanges = true; + var selected = this.basicTree.jstree(true).get_selected()[0]; + if (selected) + $scope.treeData.push({ + id: (newId++).toString(), + parent: selected, + text: "New node " + newId, + state: {opened: true} + }); + $scope.basicConfig.version++; }; - $scope.remove = function () { - $scope.current.remove(); - $scope.current = getFirstNode(); - $scope.current.selected = true; + + $scope.refresh = function () { + $scope.ignoreChanges = true; + newId = 0; + $scope.treeData = getDefaultData(); + $scope.basicConfig.version++; }; - $scope.toggle = function (scope) { - scope.toggle(); + $scope.expand = function () { + $scope.ignoreChanges = true; + $scope.treeData.forEach(function (n) { + n.state.opened = true; + }); + $scope.basicConfig.version++; }; - $scope.newSubItem = function () { - var nodeData = $scope.current.$modelValue; - nodeData.nodes.push({ - id: nodeData.id * 10 + nodeData.nodes.length, - title: nodeData.title + '.' + (nodeData.nodes.length + 1), - nodes: [] + $scope.collapse = function () { + $scope.ignoreChanges = true; + $scope.treeData.forEach(function (n) { + n.state.opened = false; + }); + $scope.basicConfig.version++; + }; + + $scope.readyCB = function() { + $timeout(function() { + $scope.ignoreChanges = false; }); }; - $scope.collapseAll = function () { - var scope = getRootNodesScope(); - scope.collapseAll(); + + $scope.applyModelChanges = function() { + return !$scope.ignoreChanges; }; - $scope.expandAll = function () { - var scope = getRootNodesScope(); - scope.expandAll(); - }; - - $scope.visible = function (item) { - return !($scope.query && $scope.query.length > 0 - && item.title.indexOf($scope.query) == -1); - }; - - $scope.basicData = getDefaultData(); - - $scope.refresh = function () { - $scope.basicData = getDefaultData(); - $scope.current = getFirstNode(); - if ($scope.current) $scope.current.selected = true; - else $scope.current = {}; - }; - - $scope.treeOptions = { - beforeDrop: function (e) { - var sourceValue = e.source.nodeScope.$modelValue.value, - destValue = e.dest.nodesScope.node ? e.dest.nodesScope.node.value : undefined; - return true; + $scope.treeData = getDefaultData(); + $scope.dragData = [ + { + "id": "nd1", + "parent": "#", + "type": "folder", + "text": "Node 1", + "state": { + "opened": true + } + }, + { + "id": "nd2", + "parent": "#", + "type": "folder", + "text": "Node 2", + "state": { + "opened": true + } + }, + { + "id": "nd3", + "parent": "#", + "type": "folder", + "text": "Node 3", + "state": { + "opened": true + } + }, + { + "id": "nd4", + "parent": "#", + "type": "folder", + "text": "Node 4", + "state": { + "opened": true + } + }, + { + "id": "nd5", + "parent": "nd1", + "text": "Node 1.1", + "state": { + "opened": true + } + }, + { + "id": "nd6", + "parent": "nd1", + "text": "Node 1.2", + "state": { + "opened": true + } + }, + { + "id": "nd7", + "parent": "nd1", + "text": "Node 1.3", + "state": { + "opened": true + } + }, + { + "id": "nd8", + "parent": "nd2", + "text": "Node 2.1", + "state": { + "opened": true + } + }, + { + "id": "nd9", + "parent": "nd2", + "text": "Node 2.2", + "state": { + "opened": true + } + }, + { + "id": "nd10", + "parent": "nd2", + "text": "Node 2.3", + "state": { + "opened": true + } + }, + { + "id": "nd11", + "parent": "nd3", + "text": "Node 3.1", + "state": { + "opened": true + } + }, + { + "id": "nd12", + "parent": "nd3", + "text": "Node 3.2", + "state": { + "opened": true + } + }, + { + "id": "nd13", + "parent": "nd3", + "text": "Node 3.3", + "state": { + "opened": true + } + }, + { + "id": "nd14", + "parent": "nd4", + "text": "Node 4.1", + "state": { + "opened": true + } + }, + { + "id": "nd15", + "parent": "nd4", + "text": "Node 4.2", + "state": { + "opened": true + } + }, + { + "id": "nd16", + "parent": "nd4", + "text": "Node 4.3", + "state": { + "opened": true + } } - }; + ]; function getDefaultData() { return [ - - { - 'id': 1, - 'title': 'Node 1', - 'nodes': [ - { - 'id': 11, - 'title': 'Node 1.1', - 'nodes': [ - { - 'id': 111, - 'title': 'Node 1.1.1', - 'nodes': [] - } - ] - }, - { - 'id': 12, - 'title': 'Node 1.2', - 'nodes': [] - } - ] - }, { - 'id': 2, - 'title': 'Node 2', - 'nodes': [ - { - 'id': 21, - 'title': 'Node 2.1', - 'nodes': [] - }, - { - 'id': 22, - 'title': 'Node 2.2', - 'nodes': [] - } - ] - }, { - 'id': 3, - 'title': 'Node 3', - 'nodes': [ - { - 'id': 31, - 'title': 'Node 3.1', - 'nodes': [] - }, - { - 'id': 32, - 'title': 'Node 3.2', - 'nodes': [{ - 'id': 321, - 'title': 'Node 3.2.1', - 'nodes': [] - }, - { - 'id': 322, - 'title': 'Node 3.2.2', - 'nodes': [] - }, - { - 'id': 323, - 'title': 'Node 3.2.3', - 'nodes': [] - }] - } - ] - }, - { - 'id': 4, - 'title': 'Node 4', - 'nodes': [ - { - 'id': 41, - 'title': 'Node 4.1', - 'nodes': [] - }] - }] - + { + "id": "n1", + "parent": "#", + "type": "folder", + "text": "Node 1", + "state": { + "opened": true + } + }, + { + "id": "n2", + "parent": "#", + "type": "folder", + "text": "Node 2", + "state": { + "opened": true + } + }, + { + "id": "n3", + "parent": "#", + "type": "folder", + "text": "Node 3", + "state": { + "opened": true + } + }, + { + "id": "n5", + "parent": "n1", + "text": "Node 1.1", + "state": { + "opened": true + } + }, + { + "id": "n6", + "parent": "n1", + "text": "Node 1.2", + "state": { + "opened": true + } + }, + { + "id": "n7", + "parent": "n1", + "text": "Node 1.3", + "state": { + "opened": true + } + }, + { + "id": "n8", + "parent": "n1", + "text": "Node 1.4", + "state": { + "opened": true + } + }, + { + "id": "n9", + "parent": "n2", + "text": "Node 2.1", + "state": { + "opened": true + } + }, + { + "id": "n10", + "parent": "n2", + "text": "Node 2.2 (Custom icon)", + "icon": "ion-help-buoy", + "state": { + "opened": true + } + }, + { + "id": "n12", + "parent": "n3", + "text": "Node 3.1", + "state": { + "opened": true + } + }, + { + "id": "n13", + "parent": "n3", + "type": "folder", + "text": "Node 3.2", + "state": { + "opened": true + } + }, + { + "id": "n14", + "parent": "n13", + "text": "Node 3.2.1", + "state": { + "opened": true + } + }, + { + "id": "n15", + "parent": "n13", + "text": "Node 3.2.2", + "state": { + "opened": true + } + }, + { + "id": "n16", + "parent": "n3", + "text": "Node 3.3", + "state": { + "opened": true + } + }, + { + "id": "n17", + "parent": "n3", + "text": "Node 3.4", + "state": { + "opened": true + } + }, + { + "id": "n18", + "parent": "n3", + "text": "Node 3.5", + "state": { + "opened": true + } + }, + { + "id": "n19", + "parent": "n3", + "text": "Node 3.6", + "state": { + "opened": true + } + } + ] } - $scope.dragData = [ - { - "id": 1, - "title": "Node 1", - "nodes": [ - { - "id": 11, - "title": "Node 1.1", - "nodes": [] - }, - { - "id": 12, - "title": "Node 1.2", - "nodes": [] - }, - { - "id": 12, - "title": "Node 1.3", - "nodes": [] - }, - { - "id": 13, - "title": "Node 1.4", - "nodes": [] - } - ] - }, - { - "id": 2, - "title": "Node 2", - "nodes": [ - { - "id": 21, - "title": "Node 2.1", - "nodes": [] - }, - { - "id": 22, - "title": "Node 2.2", - "nodes": [] - }, - { - "id": 22, - "title": "Node 2.3", - "nodes": [] - }, - { - "id": 23, - "title": "Node 2.4", - "nodes": [] - } - ] - }, - { - "id": 3, - "title": "Node 3", - "nodes": [ - { - "id": 31, - "title": "Node 3.1", - "nodes": [] - }, - { - "id": 31, - "title": "Node 3.2", - "nodes": [] - }, - { - "id": 32, - "title": "Node 3.3", - "nodes": [] - }, - { - "id": 33, - "title": "Node 3.4", - "nodes": [] - } - ] - } - ]; - $scope.find = function(){}; - $timeout(function () { - $scope.current = getFirstNode(); - if ($scope.current) $scope.current.selected = true; - else $scope.current = {}; - }, 1000); } })(); \ No newline at end of file diff --git a/src/app/theme/theme.module.js b/src/app/theme/theme.module.js index e35f74d..adf34ba 100644 --- a/src/app/theme/theme.module.js +++ b/src/app/theme/theme.module.js @@ -10,7 +10,6 @@ 'chart.js', 'angular-chartist', 'angular.morris-chart', - 'ui.tree', 'textAngular', 'BlurAdmin.theme.components' ]); diff --git a/src/assets/img/theme/timeline/cd-icon-location.svg b/src/assets/img/theme/timeline/cd-icon-location.svg deleted file mode 100644 index 934e0e4..0000000 --- a/src/assets/img/theme/timeline/cd-icon-location.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/src/assets/img/theme/timeline/cd-icon-movie.svg b/src/assets/img/theme/timeline/cd-icon-movie.svg deleted file mode 100644 index 71de0a0..0000000 --- a/src/assets/img/theme/timeline/cd-icon-movie.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/src/assets/img/theme/timeline/cd-icon-picture.svg b/src/assets/img/theme/timeline/cd-icon-picture.svg deleted file mode 100644 index 3fef3df..0000000 --- a/src/assets/img/theme/timeline/cd-icon-picture.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/src/sass/app/_email.scss b/src/sass/app/_email.scss index d14fc45..703c128 100644 --- a/src/sass/app/_email.scss +++ b/src/sass/app/_email.scss @@ -223,7 +223,7 @@ margin-left: 6px; } -.tag { +.mail-panel .tag { text-transform: lowercase; font-size: 11px; font-weight: 100; diff --git a/src/sass/app/_table.scss b/src/sass/app/_table.scss new file mode 100644 index 0000000..e1b790a --- /dev/null +++ b/src/sass/app/_table.scss @@ -0,0 +1,3 @@ +.table-panel { + height: 295px; +} diff --git a/src/sass/theme/_table.scss b/src/sass/theme/_table.scss index 10352b1..c343b7b 100644 --- a/src/sass/theme/_table.scss +++ b/src/sass/theme/_table.scss @@ -54,9 +54,6 @@ } } -.table-panel { - height: 280px; -} .editable-tr-wrap { .editable-wrap { diff --git a/src/sass/theme/_tree.scss b/src/sass/theme/_tree.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/sass/theme/dashboard/_timeline.scss b/src/sass/theme/dashboard/_timeline.scss index f2650c4..c2cbeac 100644 --- a/src/sass/theme/dashboard/_timeline.scss +++ b/src/sass/theme/dashboard/_timeline.scss @@ -38,29 +38,6 @@ width: 40px; height: 40px; border-radius: 50%; - - img { - display: block; - width: 24px; - height: 24px; - position: relative; - left: 50%; - top: 50%; - margin-left: -12px; - margin-top: -12px; - } - - &.cd-picture { - background: $success; - } - - &.cd-movie { - background: $danger; - } - - &.cd-location { - background: $primary; - } } @media only screen and (min-width: $resXL) {