From 216c488ce7edaa8ead86e8e4c512fff7323af091 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Fri, 6 Sep 2013 17:49:19 -0400 Subject: [PATCH] AC-420 unshifted shifted columns --- awx/ui/static/js/controllers/JobHosts.js | 9 +++++++++ awx/ui/static/js/forms/InventoryHosts.js | 2 +- awx/ui/static/js/lists/JobHosts.js | 2 +- awx/ui/static/lib/ansible/generator-helpers.js | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/js/controllers/JobHosts.js b/awx/ui/static/js/controllers/JobHosts.js index a8297a25e7..a6a77534ca 100644 --- a/awx/ui/static/js/controllers/JobHosts.js +++ b/awx/ui/static/js/controllers/JobHosts.js @@ -18,6 +18,15 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams, var list = JobHostList; var base = $location.path().replace(/^\//,'').split('/')[0]; var defaultUrl = GetBasePath(base) + $routeParams.id + '/job_host_summaries/'; + + // When viewing all summaries for a particular host, show job ID, otherwise row ID. + if (base == 'hosts') { + list.index = false; + } + else { + list.index = true; + } + var view = GenerateList; var scope = view.inject(list, { mode: 'edit' }); scope.selected = []; diff --git a/awx/ui/static/js/forms/InventoryHosts.js b/awx/ui/static/js/forms/InventoryHosts.js index 6064b480ea..590bd8913f 100644 --- a/awx/ui/static/js/forms/InventoryHosts.js +++ b/awx/ui/static/js/forms/InventoryHosts.js @@ -35,7 +35,7 @@ angular.module('InventoryHostsFormDefinition', []) type: 'DropDown', searchable: false, nosort: true, - label: 'View', + label: 'Jobs', "class": "btn-sm", //ngDisabled: 'host.last_job == null', options: [ diff --git a/awx/ui/static/js/lists/JobHosts.js b/awx/ui/static/js/lists/JobHosts.js index 6db18dbc3c..3e98aaa400 100644 --- a/awx/ui/static/js/lists/JobHosts.js +++ b/awx/ui/static/js/lists/JobHosts.js @@ -13,7 +13,7 @@ angular.module('JobHostDefinition', []) name: 'jobhosts', iterator: 'jobhost', editTitle: 'Job Host Summary', - indexShow: 'host_id == null', + index: true, hover: true, fields: { diff --git a/awx/ui/static/lib/ansible/generator-helpers.js b/awx/ui/static/lib/ansible/generator-helpers.js index cd88df0af4..8db10ce6e1 100644 --- a/awx/ui/static/lib/ansible/generator-helpers.js +++ b/awx/ui/static/lib/ansible/generator-helpers.js @@ -59,6 +59,9 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers']) case 'dataTitle': result = "data-title=\"" + value + "\" "; break; + case 'columnShow': + result = "ng-show=\"" + value + "\" "; + break; case 'dataPlacement': result = "data-placement=\"" + value + "\" "; break; @@ -183,6 +186,7 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers']) html += "\" "; html += (field.ngClass) ? Attr(field, 'ngClass') : ""; html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : ""; + html += (field.columnShow) ? Attr(field, 'columnShow') : ""; html += ">\n"; // Add ngShow