bastion 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +5 -6
- data/Rakefile +1 -1
- data/app/assets/javascripts/bastion/bastion-bootstrap.js +0 -4
- data/app/assets/javascripts/bastion/bastion.js +3 -9
- data/app/assets/javascripts/bastion/bastion.module.js +1 -1
- data/app/assets/javascripts/bastion/{incubator/alch-alert.directive.js → components/bst-alert.directive.js} +4 -4
- data/app/assets/javascripts/bastion/{incubator/alch-container-scroll.directive.js → components/bst-container-scroll.directive.js} +3 -3
- data/app/assets/javascripts/bastion/{incubator/alch-dropdown.directive.js → components/bst-dropdown.directive.js} +4 -4
- data/app/assets/javascripts/bastion/{incubator/alch-edit.directive.js → components/bst-edit.directive.js} +34 -34
- data/app/assets/javascripts/bastion/{incubator/alch-flyout.directive.js → components/bst-flyout.directive.js} +4 -4
- data/app/assets/javascripts/bastion/{incubator/alch-form-buttons.directive.js → components/bst-form-buttons.directive.js} +4 -4
- data/app/assets/javascripts/bastion/{incubator/alch-form-group.directive.js → components/bst-form-group.directive.js} +4 -4
- data/app/assets/javascripts/bastion/{incubator/alch-infinite-scroll.directive.js → components/bst-infinite-scroll.directive.js} +5 -5
- data/app/assets/javascripts/bastion/{incubator/alch-menu.directive.js → components/bst-menu.directive.js} +4 -4
- data/app/assets/javascripts/bastion/{incubator/alch-modal.directive.js → components/bst-modal.directive.js} +5 -5
- data/app/assets/javascripts/bastion/components/bst-on-enter.directive.js +41 -0
- data/app/assets/javascripts/bastion/{incubator/alch-save-control.directive.js → components/bst-save-control.directive.js} +4 -4
- data/app/assets/javascripts/bastion/{incubator/alch-table.directive.js → components/bst-table.directive.js} +31 -31
- data/app/assets/javascripts/bastion/components/components.module.js +27 -0
- data/app/assets/javascripts/bastion/{widgets → components}/current-tasks.directive.js +3 -3
- data/app/assets/javascripts/bastion/{incubator/format → components/formatters}/array-to-string.filter.js +2 -2
- data/app/assets/javascripts/bastion/{incubator/format → components/formatters}/boolean-to-yes-no.filter.js +2 -2
- data/app/assets/javascripts/bastion/{incubator/format → components/formatters}/capitalize.filter.js +2 -2
- data/app/assets/javascripts/bastion/{incubator/format/alch-format.module.js → components/formatters/components-formatters.module.js} +2 -2
- data/app/assets/javascripts/bastion/{incubator/format → components/formatters}/key-value-to-string.filter.js +2 -2
- data/app/assets/javascripts/bastion/{incubator/format → components/formatters}/unlimitedFilter.filter.js +3 -3
- data/app/assets/javascripts/bastion/{widgets → components}/nutupane-table.directive.js +1 -1
- data/app/assets/javascripts/bastion/{widgets → components}/nutupane.factory.js +2 -2
- data/app/assets/javascripts/bastion/{widgets → components}/page-title.directive.js +2 -2
- data/app/assets/javascripts/bastion/{widgets → components}/page-title.service.js +2 -2
- data/app/assets/javascripts/bastion/{widgets → components}/path-selector.directive.js +3 -3
- data/app/assets/javascripts/bastion/{incubator/views/alch-alert.html → components/views/bst-alert.html} +0 -0
- data/app/assets/javascripts/bastion/{incubator/views/alch-dropdown.html → components/views/bst-dropdown.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-add-item.html → components/views/bst-edit-add-item.html} +0 -0
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-add-remove-cancel.html → components/views/bst-edit-add-remove-cancel.html} +0 -0
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-checkbox.html → components/views/bst-edit-checkbox.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-custom.html → components/views/bst-edit-custom.html} +2 -2
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-multiselect.html → components/views/bst-edit-multiselect.html} +2 -2
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-save-cancel.html → components/views/bst-edit-save-cancel.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-select.html → components/views/bst-edit-select.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-text.html → components/views/bst-edit-text.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit-textarea.html → components/views/bst-edit-textarea.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-edit.html → components/views/bst-edit.html} +3 -3
- data/app/assets/javascripts/bastion/{incubator/views/alch-flyout.html → components/views/bst-flyout.html} +0 -0
- data/app/assets/javascripts/bastion/{incubator/views/alch-form-buttons.html → components/views/bst-form-buttons.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-form-group.html → components/views/bst-form-group.html} +0 -0
- data/app/assets/javascripts/bastion/{incubator/views/alch-menu.html → components/views/bst-menu.html} +1 -1
- data/app/assets/javascripts/bastion/{incubator/views/alch-modal-remove.html → components/views/bst-modal.html} +0 -0
- data/app/assets/javascripts/bastion/{incubator/views/alch-save-control.html → components/views/bst-save-control.html} +0 -0
- data/app/assets/javascripts/bastion/{widgets → components}/views/current-tasks.html +0 -0
- data/app/assets/javascripts/bastion/{widgets → components}/views/path-selector.html +0 -0
- data/app/assets/javascripts/bastion/i18n/katello.pot +18 -18
- data/app/assets/javascripts/bastion/layouts/details-nutupane.html +4 -4
- data/app/assets/javascripts/bastion/layouts/nutupane.html +4 -4
- data/app/assets/javascripts/bastion/menu/menu.module.js +1 -3
- data/app/views/bastion/layouts/application.html.erb +5 -1
- data/bower.json +0 -5
- data/grunt/karma.js +4 -5
- data/lib/bastion/version.rb +1 -1
- data/test/{incubator/alch-alert.directive.test.js → components/bst-alert.directive.test.js} +3 -3
- data/test/{incubator/alch-container-scroll.directive.test.js → components/bst-container-scroll.directive.test.js} +3 -3
- data/test/{incubator/alch-dropdown.directive.test.js → components/bst-dropdown.directive.test.js} +5 -5
- data/test/{incubator/alch-edit.directive.test.js → components/bst-edit.directive.test.js} +29 -29
- data/test/{incubator/alch-flyout.directive.test.js → components/bst-flyout.directive.test.js} +3 -3
- data/test/{incubator/alch-form-buttons.directive.test.js → components/bst-form-buttons.directive.test.js} +5 -5
- data/test/{incubator/alch-form-group.directive.test.js → components/bst-form-group.directive.test.js} +4 -4
- data/test/{incubator/alch-infinite-scroll.directive.test.js → components/bst-infinite-scroll.directive.test.js} +3 -3
- data/test/{incubator/alch-menu.directive.test.js → components/bst-menu.directive.test.js} +6 -6
- data/test/{incubator/alch-modal.directive.test.js → components/bst-modal.directive.test.js} +3 -3
- data/test/{incubator/nutupane-table.directive.test.js → components/bst-nutupane-table.directive.test.js} +1 -1
- data/test/{incubator/alch-table.directive.test.js → components/bst-table.directive.test.js} +21 -21
- data/test/{incubator/format → components/formatters}/array-to-string.filter.test.js +1 -1
- data/test/{incubator/format → components/formatters}/boolean-to-yes-no.filter.test.js +1 -1
- data/test/{incubator/format → components/formatters}/capitalize.filter.test.js +1 -1
- data/test/{incubator/format → components/formatters}/key-value-to-string.filter.test.js +1 -1
- data/test/{incubator/format → components/formatters}/unlimited-filter.filter.test.js +1 -1
- data/test/{incubator → components}/nutupane.factory.test.js +1 -1
- data/test/{widgets → components}/page-title.directive.test.js +1 -1
- data/test/{widgets → components}/page-title.service.test.js +1 -1
- data/test/{widgets → components}/path-selector.directive.test.js +2 -2
- metadata +105 -113
- data/app/assets/javascripts/bastion/incubator/stylesheets/alch-edit.scss +0 -34
- data/app/assets/javascripts/bastion/incubator/stylesheets/header.scss +0 -207
- data/app/assets/javascripts/bastion/widgets/widgets.module.js +0 -24
- data/vendor/assets/javascripts/bastion/alchemy/alchemy.js +0 -20
- data/vendor/assets/stylesheets/bastion/alchemy/_colors.scss +0 -99
- data/vendor/assets/stylesheets/bastion/alchemy/_media_object.scss +0 -22
- data/vendor/assets/stylesheets/bastion/alchemy/_mixins.scss +0 -24
- data/vendor/assets/stylesheets/bastion/alchemy/_normalize.scss +0 -396
- data/vendor/assets/stylesheets/bastion/alchemy/_vars.scss +0 -31
- data/vendor/assets/stylesheets/bastion/alchemy/alchemy.scss +0 -8
@@ -13,27 +13,27 @@
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @ngdoc directive
|
16
|
-
* @name
|
16
|
+
* @name Bastion.components.directive:bstInfiniteScroll
|
17
17
|
*
|
18
18
|
* @description
|
19
19
|
* The infinite scroll directive should be applied to a wrapping div around another element
|
20
20
|
* and provides automatic loading when a user scrolls to the bottom of the element.
|
21
21
|
*
|
22
|
-
* Note that the element using the
|
22
|
+
* Note that the element using the bst-infinite-scroll directive should have it's overflow
|
23
23
|
* set properly.
|
24
24
|
*
|
25
25
|
* @example
|
26
26
|
* <pre>
|
27
|
-
* <div
|
27
|
+
* <div bst-infinite-scroll="loadMore()" style="height: 100px; overflow-y: auto;">
|
28
28
|
* <p style="height: 1000px;">Hello</p>
|
29
29
|
* </div>
|
30
30
|
* </pre>
|
31
31
|
*/
|
32
|
-
angular.module('
|
32
|
+
angular.module('Bastion.components').directive('bstInfiniteScroll', [function () {
|
33
33
|
return {
|
34
34
|
scope: {
|
35
35
|
data: '=',
|
36
|
-
loadMoreFunction: '&
|
36
|
+
loadMoreFunction: '&bstInfiniteScroll',
|
37
37
|
skipInitialLoad: '='
|
38
38
|
},
|
39
39
|
controller: function ($scope, $element) {
|
@@ -1,21 +1,21 @@
|
|
1
1
|
/**
|
2
2
|
* @ngdoc directive
|
3
|
-
* @name
|
3
|
+
* @name Bastion.components.directive:bstMenu
|
4
4
|
* @restrict EA
|
5
5
|
* @requires $window
|
6
6
|
*
|
7
7
|
* @description
|
8
8
|
* Provides a menu.
|
9
9
|
*/
|
10
|
-
angular.module('
|
10
|
+
angular.module('Bastion.components').directive('bstMenu', ['$window', function ($window) {
|
11
11
|
return {
|
12
12
|
restrict: 'EA',
|
13
13
|
replace: true,
|
14
14
|
scope: {
|
15
|
-
'menu': '=
|
15
|
+
'menu': '=bstMenu',
|
16
16
|
'compact' : '@'
|
17
17
|
},
|
18
|
-
templateUrl: '
|
18
|
+
templateUrl: 'components/views/bst-menu.html',
|
19
19
|
controller: ['$scope', function ($scope) {
|
20
20
|
$scope.dropdown = {};
|
21
21
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @ngdoc directive
|
16
|
-
* @name
|
16
|
+
* @name Bastion.components.directive:bstModal
|
17
17
|
* @restrict A
|
18
18
|
*
|
19
19
|
* @requires $templateCache
|
@@ -22,14 +22,14 @@
|
|
22
22
|
* @description
|
23
23
|
* Provides a wrapper around angular-ui's modal dialog service.
|
24
24
|
*/
|
25
|
-
angular.module('
|
25
|
+
angular.module('Bastion.components').directive('bstModal',
|
26
26
|
['$templateCache', '$modal', function ($templateCache, $modal) {
|
27
27
|
return {
|
28
28
|
// To be expanded when we add additional type of modals
|
29
|
-
templateUrl: '
|
29
|
+
templateUrl: 'components/views/bst-modal.html',
|
30
30
|
replace: true,
|
31
31
|
scope: {
|
32
|
-
action: '&
|
32
|
+
action: '&bstModal',
|
33
33
|
modelName: '@model',
|
34
34
|
model: '=',
|
35
35
|
modalHeader: '@',
|
@@ -39,7 +39,7 @@ angular.module('alchemy').directive('alchModal',
|
|
39
39
|
return function (scope) {
|
40
40
|
var modalInstance, modalController, modalId;
|
41
41
|
|
42
|
-
modalId = '
|
42
|
+
modalId = 'bstModal%d.html'.replace('%d', Math.random().toString());
|
43
43
|
|
44
44
|
modalController = ['$scope', '$modalInstance', 'model', function ($scope, $modalInstance, model) {
|
45
45
|
$scope[scope.modelName] = model;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2014 Red Hat, Inc.
|
3
|
+
*
|
4
|
+
* This software is licensed to you under the GNU General Public
|
5
|
+
* License as published by the Free Software Foundation; either version
|
6
|
+
* 2 of the License (GPLv2) or (at your option) any later version.
|
7
|
+
* There is NO WARRANTY for this software, express or implied,
|
8
|
+
* including the implied warranties of MERCHANTABILITY,
|
9
|
+
* NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
10
|
+
* have received a copy of GPLv2 along with this software; if not, see
|
11
|
+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
12
|
+
**/
|
13
|
+
|
14
|
+
(function () {
|
15
|
+
'use strict';
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @ngdoc directive
|
19
|
+
* @name Bastion.components.directive:bstOnEnter
|
20
|
+
*
|
21
|
+
* @description
|
22
|
+
* Allows setting an action to be performed when the user presses the enter button.
|
23
|
+
*/
|
24
|
+
function bstOnEnter() {
|
25
|
+
return {
|
26
|
+
scope: true,
|
27
|
+
link: function (scope, element, attrs) {
|
28
|
+
element.bind('keydown keypress', function (event) {
|
29
|
+
if (event.which === 13) {
|
30
|
+
scope.$apply(attrs.bstOnEnter);
|
31
|
+
}
|
32
|
+
});
|
33
|
+
}
|
34
|
+
};
|
35
|
+
}
|
36
|
+
|
37
|
+
angular
|
38
|
+
.module('Bastion.components')
|
39
|
+
.directive('bstOnEnter', bstOnEnter);
|
40
|
+
|
41
|
+
})();
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @ngdoc directive
|
16
|
-
* @name
|
16
|
+
* @name Bastion.components.directive:bstSaveControl
|
17
17
|
*
|
18
18
|
* @description
|
19
19
|
* Simple directive for encapsulating create and cancel buttons. This includes states
|
@@ -21,17 +21,17 @@
|
|
21
21
|
*
|
22
22
|
* @example
|
23
23
|
* <pre>
|
24
|
-
* <div
|
24
|
+
* <div bst-save-control
|
25
25
|
* on-cancel="closeItem()"
|
26
26
|
* on-save="save(product)"
|
27
27
|
* invalid="productForm.$invalid">
|
28
28
|
* </div>
|
29
29
|
*/
|
30
|
-
angular.module('
|
30
|
+
angular.module('Bastion.components').directive('bstSaveControl', function () {
|
31
31
|
return {
|
32
32
|
restrict: 'AE',
|
33
33
|
replace: true,
|
34
|
-
templateUrl: '
|
34
|
+
templateUrl: 'components/views/bst-save-control.html',
|
35
35
|
scope: {
|
36
36
|
handleSave: '&onSave',
|
37
37
|
handleCancel: '&onCancel',
|
@@ -1,26 +1,26 @@
|
|
1
1
|
/**
|
2
2
|
* @ngdoc directive
|
3
|
-
* @name
|
3
|
+
* @name Bastion.components.directive:bstTable
|
4
4
|
* @restrict A
|
5
5
|
*
|
6
6
|
* @description
|
7
7
|
*
|
8
8
|
* @example
|
9
9
|
*/
|
10
|
-
angular.module('
|
11
|
-
.directive('
|
10
|
+
angular.module('Bastion.components')
|
11
|
+
.directive('bstTable', [function () {
|
12
12
|
return {
|
13
13
|
restrict: 'A',
|
14
14
|
replace: true,
|
15
15
|
scope: {
|
16
|
-
'table': '=
|
16
|
+
'table': '=bstTable',
|
17
17
|
'rowSelect': '@',
|
18
18
|
'rowChoice': '@'
|
19
19
|
},
|
20
|
-
controller: '
|
20
|
+
controller: 'BstTableController'
|
21
21
|
};
|
22
22
|
}])
|
23
|
-
.controller('
|
23
|
+
.controller('BstTableController', ['$scope', function ($scope) {
|
24
24
|
var rows = $scope.rows = [],
|
25
25
|
headers = $scope.headers = [],
|
26
26
|
self = this;
|
@@ -94,7 +94,7 @@ angular.module('alchemy')
|
|
94
94
|
};
|
95
95
|
|
96
96
|
}])
|
97
|
-
.directive('
|
97
|
+
.directive('bstTableHead', [function () {
|
98
98
|
var rowSelectTemplate = function () {
|
99
99
|
return '<th class="row-select">' +
|
100
100
|
'<input type="checkbox"' +
|
@@ -107,10 +107,10 @@ angular.module('alchemy')
|
|
107
107
|
};
|
108
108
|
|
109
109
|
return {
|
110
|
-
require: '^
|
110
|
+
require: '^bstTable',
|
111
111
|
restrict: 'A',
|
112
112
|
scope: true,
|
113
|
-
controller: '
|
113
|
+
controller: 'BstTableHeadController',
|
114
114
|
compile: function (tElement, tAttrs) {
|
115
115
|
if (tAttrs.rowSelect !== undefined) {
|
116
116
|
tElement.prepend(rowSelectTemplate());
|
@@ -118,25 +118,25 @@ angular.module('alchemy')
|
|
118
118
|
tElement.prepend(rowChoiceTemplate());
|
119
119
|
}
|
120
120
|
|
121
|
-
return function (scope, element, attrs,
|
121
|
+
return function (scope, element, attrs, bstTableController) {
|
122
122
|
if (tAttrs.rowSelect !== undefined) {
|
123
123
|
scope.table.rowSelect = true;
|
124
124
|
} else if (tAttrs.rowChoice !== undefined) {
|
125
125
|
scope.table.rowChoice = true;
|
126
126
|
}
|
127
127
|
|
128
|
-
|
128
|
+
bstTableController.addHeader(scope.header);
|
129
129
|
|
130
|
-
scope.selection =
|
130
|
+
scope.selection = bstTableController.selection;
|
131
131
|
|
132
132
|
scope.allSelected = function () {
|
133
|
-
|
133
|
+
bstTableController.selectAll(scope.selection.allSelected);
|
134
134
|
};
|
135
135
|
};
|
136
136
|
}
|
137
137
|
};
|
138
138
|
}])
|
139
|
-
.controller('
|
139
|
+
.controller('BstTableHeadController', ['$scope', function ($scope) {
|
140
140
|
$scope.header = {
|
141
141
|
columns: []
|
142
142
|
};
|
@@ -145,12 +145,12 @@ angular.module('alchemy')
|
|
145
145
|
$scope.header.columns.push(column);
|
146
146
|
};
|
147
147
|
}])
|
148
|
-
.directive('
|
148
|
+
.directive('bstTableColumn', ['$compile', function ($compile) {
|
149
149
|
var sortIconTemplate = '<th ng-click="table.sortBy(column)">' +
|
150
150
|
'<i class="sort-icon" ng-show="table.resource.sort.by == column.id" ng-class="{\'icon-sort-down\': column.sortOrder == \'DESC\', \'icon-sort-up\': column.sortOrder == \'ASC\'}"></i>' +
|
151
151
|
'</th>';
|
152
152
|
return {
|
153
|
-
require: '^
|
153
|
+
require: '^bstTableHead',
|
154
154
|
restrict: 'A',
|
155
155
|
scope: true,
|
156
156
|
controller: ['$scope', function ($scope) {
|
@@ -164,12 +164,12 @@ angular.module('alchemy')
|
|
164
164
|
newElement.addClass(element.attr('class'));
|
165
165
|
element.replaceWith(newElement);
|
166
166
|
}
|
167
|
-
return function (scope, element, attributes,
|
167
|
+
return function (scope, element, attributes, bstTableHeadController) {
|
168
168
|
if (attributes.hasOwnProperty("sortable")) {
|
169
169
|
$compile(element)(scope);
|
170
170
|
}
|
171
|
-
scope.column.id = attributes["
|
172
|
-
|
171
|
+
scope.column.id = attributes["bstTableColumn"];
|
172
|
+
bstTableHeadController.addColumn(scope.column);
|
173
173
|
|
174
174
|
scope.$watch('column.show', function (show) {
|
175
175
|
var display = show ? '' : 'none';
|
@@ -179,7 +179,7 @@ angular.module('alchemy')
|
|
179
179
|
}
|
180
180
|
};
|
181
181
|
}])
|
182
|
-
.directive('
|
182
|
+
.directive('bstTableRow', ['$parse', function ($parse) {
|
183
183
|
var rowSelectTemplate, rowChoiceTemplate, activeRowTemplate;
|
184
184
|
|
185
185
|
rowSelectTemplate = function (model) {
|
@@ -206,10 +206,10 @@ angular.module('alchemy')
|
|
206
206
|
};
|
207
207
|
|
208
208
|
return {
|
209
|
-
require: '^
|
209
|
+
require: '^bstTable',
|
210
210
|
restrict: 'A',
|
211
211
|
scope: true,
|
212
|
-
controller: '
|
212
|
+
controller: 'BstTableRowController',
|
213
213
|
compile: function (tElement, tAttrs) {
|
214
214
|
|
215
215
|
if (tAttrs.activeRow !== undefined) {
|
@@ -228,8 +228,8 @@ angular.module('alchemy')
|
|
228
228
|
tElement.find('td').attr('ng-class', '{ "active-row": ' + tAttrs.activeRow + ' }');
|
229
229
|
}
|
230
230
|
|
231
|
-
return function (scope, element, attrs,
|
232
|
-
|
231
|
+
return function (scope, element, attrs, bstTableController) {
|
232
|
+
bstTableController.addRow(scope.row);
|
233
233
|
|
234
234
|
if (attrs.rowSelect) {
|
235
235
|
scope.model = $parse(attrs.rowSelect)(scope);
|
@@ -254,19 +254,19 @@ angular.module('alchemy')
|
|
254
254
|
}
|
255
255
|
|
256
256
|
scope.itemSelected = function (row) {
|
257
|
-
|
257
|
+
bstTableController.itemSelected(row);
|
258
258
|
};
|
259
259
|
|
260
260
|
scope.itemChosen = function (row) {
|
261
261
|
element.parent().find('.selected-row').removeClass('selected-row');
|
262
262
|
element.addClass('selected-row');
|
263
|
-
|
263
|
+
bstTableController.itemChosen(row);
|
264
264
|
};
|
265
265
|
};
|
266
266
|
}
|
267
267
|
};
|
268
268
|
}])
|
269
|
-
.controller('
|
269
|
+
.controller('BstTableRowController', ['$scope', function ($scope) {
|
270
270
|
$scope.row = {
|
271
271
|
cells: []
|
272
272
|
};
|
@@ -275,16 +275,16 @@ angular.module('alchemy')
|
|
275
275
|
$scope.row.cells.push(cell);
|
276
276
|
};
|
277
277
|
}])
|
278
|
-
.directive('
|
278
|
+
.directive('bstTableCell', [function () {
|
279
279
|
return {
|
280
|
-
require: '^
|
280
|
+
require: '^bstTableRow',
|
281
281
|
restrict: 'A',
|
282
282
|
scope: true,
|
283
283
|
controller: ['$scope', function ($scope) {
|
284
284
|
$scope.cell = { show: true };
|
285
285
|
}],
|
286
|
-
link: function (scope, element, attrs,
|
287
|
-
|
286
|
+
link: function (scope, element, attrs, bstTableRowController) {
|
287
|
+
bstTableRowController.addCell(scope.cell);
|
288
288
|
|
289
289
|
scope.$watch('cell.show', function (show) {
|
290
290
|
var display = show ? '' : 'none';
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2014 Red Hat, Inc.
|
3
|
+
*
|
4
|
+
* This software is licensed to you under the GNU General Public
|
5
|
+
* License as published by the Free Software Foundation; either version
|
6
|
+
* 2 of the License (GPLv2) or (at your option) any later version.
|
7
|
+
* There is NO WARRANTY for this software, express or implied,
|
8
|
+
* including the implied warranties of MERCHANTABILITY,
|
9
|
+
* NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
10
|
+
* have received a copy of GPLv2 along with this software; if not, see
|
11
|
+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
12
|
+
**/
|
13
|
+
|
14
|
+
(function () {
|
15
|
+
'use strict';
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @ngdoc module
|
19
|
+
* @name Bastion.components
|
20
|
+
*
|
21
|
+
* @description
|
22
|
+
* Cross application re-usable components
|
23
|
+
*/
|
24
|
+
angular
|
25
|
+
.module('Bastion.components', []);
|
26
|
+
|
27
|
+
})();
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @ngdoc directive
|
16
|
-
* @name Bastion.
|
16
|
+
* @name Bastion.components.directive:currentTasks
|
17
17
|
*
|
18
18
|
* @requires $document
|
19
19
|
* @requires CurrentUser
|
@@ -26,14 +26,14 @@
|
|
26
26
|
* @example
|
27
27
|
<span current-tasks></span>
|
28
28
|
*/
|
29
|
-
angular.module('Bastion.
|
29
|
+
angular.module('Bastion.components').directive('currentTasks',
|
30
30
|
['$document', 'CurrentUser', 'Task',
|
31
31
|
function ($document, CurrentUser, Task) {
|
32
32
|
|
33
33
|
return {
|
34
34
|
restrict: 'A',
|
35
35
|
scope: true,
|
36
|
-
templateUrl: '
|
36
|
+
templateUrl: 'components/views/current-tasks.html',
|
37
37
|
|
38
38
|
controller: ['$scope', function ($scope) {
|
39
39
|
// Hide the current tasks list if the user clicks outside of it
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @ngdoc filter
|
16
|
-
* @name
|
16
|
+
* @name Bastion.components.formatters.filter:arrayToString
|
17
17
|
*
|
18
18
|
* @description
|
19
19
|
*
|
@@ -21,7 +21,7 @@
|
|
21
21
|
* @example
|
22
22
|
*
|
23
23
|
*/
|
24
|
-
angular.module('
|
24
|
+
angular.module('Bastion.components.formatters').filter('arrayToString', [function () {
|
25
25
|
return function (toFormat, stringToPluck, separator) {
|
26
26
|
stringToPluck = stringToPluck || 'name';
|
27
27
|
separator = separator || ', ';
|
@@ -13,14 +13,14 @@
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @ngdoc filter
|
16
|
-
* @name
|
16
|
+
* @name Bastion.components.formatters.filter:booleanToYesNo
|
17
17
|
*
|
18
18
|
* @requires translate
|
19
19
|
*
|
20
20
|
* @description
|
21
21
|
* Provides a filter to convert a boolean to Yes/No
|
22
22
|
*/
|
23
|
-
angular.module('
|
23
|
+
angular.module('Bastion.components.formatters').filter('booleanToYesNo', ['translate', function (translate) {
|
24
24
|
return function (boolValue, yesValue, noValue) {
|
25
25
|
yesValue = yesValue || translate("Yes");
|
26
26
|
noValue = noValue || translate("No");
|