From a0debbe502ee64bfd473cd7be9cfccc21e539776 Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Wed, 27 Apr 2016 00:13:31 -0400 Subject: [PATCH 1/2] add children count badges to Inventories > Groups. resolves #1600 --- .../manage/inventory-manage.controller.js | 4 +-- awx/ui/client/src/lists/InventoryGroups.js | 8 ++++- .../client/src/shared/bootstrap-settings.less | 4 +++ awx/ui/client/src/shared/generator-helpers.js | 34 +++++++++---------- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/awx/ui/client/src/inventories/manage/inventory-manage.controller.js b/awx/ui/client/src/inventories/manage/inventory-manage.controller.js index 96dd9a9936..03e641e98a 100644 --- a/awx/ui/client/src/inventories/manage/inventory-manage.controller.js +++ b/awx/ui/client/src/inventories/manage/inventory-manage.controller.js @@ -153,8 +153,6 @@ function InventoriesManage($log, $scope, $rootScope, $location, } $scope.removeInventoryLoaded = $scope.$on('InventoryLoaded', function() { var rows; - - // Add groups view generateList.inject(InventoryGroups, { mode: 'edit', id: 'group-list-container', @@ -529,5 +527,5 @@ export default [ 'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete', 'EditInventoryProperties', 'ToggleHostEnabled', 'ShowJobSummary', 'InventoryGroupsHelp', 'HelpDialog', 'GroupsCopy', - 'HostsCopy', '$stateParams', 'ParamPass', InventoriesManage, + 'HostsCopy', '$stateParams', 'ParamPass', InventoriesManage ]; diff --git a/awx/ui/client/src/lists/InventoryGroups.js b/awx/ui/client/src/lists/InventoryGroups.js index db3f2bc7a0..984a086c2d 100644 --- a/awx/ui/client/src/lists/InventoryGroups.js +++ b/awx/ui/client/src/lists/InventoryGroups.js @@ -25,7 +25,13 @@ export default key: true, ngClick: "groupSelect(group.id)", columnClick: "groupSelect(group.id)", - columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6' + columnClass: 'col-lg-3 col-md-3 col-sm-3 col-xs-3' + }, + total_groups: { + nosort: true, + label: '', + type: 'badgeCount', + ngHide: '{{group.total_groups == 0}}', }, source: { label: 'Source', diff --git a/awx/ui/client/src/shared/bootstrap-settings.less b/awx/ui/client/src/shared/bootstrap-settings.less index c0c300c74a..47b3ae08f9 100644 --- a/awx/ui/client/src/shared/bootstrap-settings.less +++ b/awx/ui/client/src/shared/bootstrap-settings.less @@ -19,4 +19,8 @@ :focus{ background: @btn-bg-sel; } +} +.List-tableRow .badge, { + padding: 3px 15px; + border-radius: 6px; } \ No newline at end of file diff --git a/awx/ui/client/src/shared/generator-helpers.js b/awx/ui/client/src/shared/generator-helpers.js index e23b7a9a6b..54269193fd 100644 --- a/awx/ui/client/src/shared/generator-helpers.js +++ b/awx/ui/client/src/shared/generator-helpers.js @@ -268,29 +268,27 @@ angular.module('GeneratorHelpers', [systemStatus.name]) .factory('BadgeCount', [ function () { return function (params) { - // Adds a badge count with optional tooltip var list = params.list, fld = params.fld, field = list.fields[fld], - html; - - html = "\n"; - html += ""; - html += "{{ " + list.iterator + '.' + fld + " }}"; - html += ""; - html += (field.badgeLabel) ? " " + field.badgeLabel : ""; - html += "\n"; - html += "\n"; + html = ''; + html = "\n"; + html += ""; + html += "{{ " + list.iterator + '.' + fld + " }}"; + html += ""; + html += (field.badgeLabel) ? " " + field.badgeLabel : ""; + html += "\n"; + html += "\n"; return html; }; } From e0aad49d07804ff7ceb1d2a3dbab43fab0fb637f Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Wed, 27 Apr 2016 11:28:19 -0400 Subject: [PATCH 2/2] rebase branch from devel && remove unnecessary interpolation tags PR #1709 --- awx/ui/client/src/lists/InventoryGroups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/lists/InventoryGroups.js b/awx/ui/client/src/lists/InventoryGroups.js index 984a086c2d..3185945a1d 100644 --- a/awx/ui/client/src/lists/InventoryGroups.js +++ b/awx/ui/client/src/lists/InventoryGroups.js @@ -31,7 +31,7 @@ export default nosort: true, label: '', type: 'badgeCount', - ngHide: '{{group.total_groups == 0}}', + ngHide: 'group.total_groups == 0', }, source: { label: 'Source',