diff --git a/lib/ui/static/js/controllers/Admins.js b/lib/ui/static/js/controllers/Admins.js index c2a86a1c7f..65b4ab2fda 100644 --- a/lib/ui/static/js/controllers/Admins.js +++ b/lib/ui/static/js/controllers/Admins.js @@ -89,12 +89,22 @@ function AdminsList ($scope, $rootScope, $location, $log, $routeParams, Rest, } } - scope.toggle_admin = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_admin = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; } } } diff --git a/lib/ui/static/js/controllers/Credentials.js b/lib/ui/static/js/controllers/Credentials.js index 910b83577e..dd73876716 100644 --- a/lib/ui/static/js/controllers/Credentials.js +++ b/lib/ui/static/js/controllers/Credentials.js @@ -119,16 +119,26 @@ function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Res else { ReturnToCaller(); } - } + } - scope.toggle_credential = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_credential = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; + } } - } } CredentialsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'CredentialList', 'GenerateList', diff --git a/lib/ui/static/js/controllers/Groups.js b/lib/ui/static/js/controllers/Groups.js index 5a35468e33..81ab3f86d3 100644 --- a/lib/ui/static/js/controllers/Groups.js +++ b/lib/ui/static/js/controllers/Groups.js @@ -120,12 +120,22 @@ function GroupsList ($scope, $rootScope, $location, $log, $routeParams, Rest, } } - scope.toggle_group = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_group = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; } } diff --git a/lib/ui/static/js/controllers/Hosts.js b/lib/ui/static/js/controllers/Hosts.js index ca210635fa..12c1d7432f 100644 --- a/lib/ui/static/js/controllers/Hosts.js +++ b/lib/ui/static/js/controllers/Hosts.js @@ -117,16 +117,26 @@ function HostsList ($scope, $rootScope, $location, $log, $routeParams, Rest, else { ReturnToCaller(1); } - } + } - scope.toggle_host = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_host = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; + } } - } } diff --git a/lib/ui/static/js/controllers/Inventories.js b/lib/ui/static/js/controllers/Inventories.js index 8d83c8bcff..09f084f097 100644 --- a/lib/ui/static/js/controllers/Inventories.js +++ b/lib/ui/static/js/controllers/Inventories.js @@ -120,16 +120,26 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res else { ReturnToCaller(); } - } + } - scope.toggle_inventory = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_inventory = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; + } } - } } InventoriesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'InventoryList', 'GenerateList', diff --git a/lib/ui/static/js/controllers/JobTemplates.js b/lib/ui/static/js/controllers/JobTemplates.js index c41e0e5b96..27d0ff775b 100644 --- a/lib/ui/static/js/controllers/JobTemplates.js +++ b/lib/ui/static/js/controllers/JobTemplates.js @@ -114,16 +114,26 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re else { ReturnToCaller(1); } - } + } - scope.toggle_credential = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_job_template = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; + } } - } function postJob(data) { // Once we have a credential and all required passwords, use this diff --git a/lib/ui/static/js/controllers/Projects.js b/lib/ui/static/js/controllers/Projects.js index 26dedffb12..bfd6a05189 100644 --- a/lib/ui/static/js/controllers/Projects.js +++ b/lib/ui/static/js/controllers/Projects.js @@ -116,14 +116,24 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, } } - scope.toggle_project = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_project = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; + } } - } } ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList', diff --git a/lib/ui/static/js/controllers/Teams.js b/lib/ui/static/js/controllers/Teams.js index 2bf231a1ec..9494a09d54 100644 --- a/lib/ui/static/js/controllers/Teams.js +++ b/lib/ui/static/js/controllers/Teams.js @@ -130,12 +130,22 @@ function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Ale } } - scope.toggle_team = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_team = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; } } } diff --git a/lib/ui/static/js/controllers/Users.js b/lib/ui/static/js/controllers/Users.js index fa0d0a4b44..412314bbe4 100644 --- a/lib/ui/static/js/controllers/Users.js +++ b/lib/ui/static/js/controllers/Users.js @@ -115,16 +115,26 @@ function UsersList ($scope, $rootScope, $location, $log, $routeParams, Rest, else { ReturnToCaller(); } - } + } - scope.toggle_user = function(idx) { - if (scope.selected.indexOf(idx) > -1) { - scope.selected.splice(scope.selected.indexOf(idx),1); + scope.toggle_user = function(id) { + if (scope.selected.indexOf(id) > -1) { + scope.selected.splice(scope.selected.indexOf(id),1); } else { - scope.selected.push(idx); + scope.selected.push(id); + } + if (scope[list.iterator + "_" + id + "_class"] == "success") { + scope[list.iterator + "_" + id + "_class"] = ""; + //$('input[name="check_' + id + '"]').checked = false; + document.getElementById('check_' + id).checked = false; + } + else { + scope[list.iterator + "_" + id + "_class"] = "success"; + //$('input[name="check_' + id + '"]').checked = true; + document.getElementById('check_' + id).checked = true; + } } - } } UsersList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'UserList', 'GenerateList', @@ -135,7 +145,7 @@ function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope) { ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior - //scope. + //scope. // Inject dynamic view var defaultUrl = '/api/v1/organizations/'; diff --git a/lib/ui/static/js/lists/Admins.js b/lib/ui/static/js/lists/Admins.js index e936ebc386..896aafa8e8 100644 --- a/lib/ui/static/js/lists/Admins.js +++ b/lib/ui/static/js/lists/Admins.js @@ -14,7 +14,7 @@ angular.module('AdminListDefinition', []) iterator: 'admin', selectTitle: 'Add Administrators', editTitle: 'Admins', - selectInstructions: 'Click the Select checkbox next to each user to be added. Click the Finished button when done.', + selectInstructions: 'Click on a row to select it. Click the Finished button when done.', base: 'users', fields: { diff --git a/lib/ui/static/js/lists/Groups.js b/lib/ui/static/js/lists/Groups.js index e8d01e08cb..22bdfd58a3 100644 --- a/lib/ui/static/js/lists/Groups.js +++ b/lib/ui/static/js/lists/Groups.js @@ -14,7 +14,7 @@ angular.module('GroupListDefinition', []) iterator: 'group', selectTitle: 'Add Group', editTitle: 'Groups', - selectInstructions: 'Check the Select checkbox next to each group to be added, and click Finished when done. Use the green button to create a new group.', + selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green button to create a new row.', fields: { name: { diff --git a/lib/ui/static/js/lists/Hosts.js b/lib/ui/static/js/lists/Hosts.js index 029940628b..4eff843b70 100644 --- a/lib/ui/static/js/lists/Hosts.js +++ b/lib/ui/static/js/lists/Hosts.js @@ -13,7 +13,7 @@ angular.module('HostListDefinition', []) name: 'hosts', iterator: 'host', selectTitle: 'Add Host', - selectInstructions: 'Check the Select checkbox next to each host to be added, and click Finished when done. Use the green button to create a new host.', + selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green button to create a new row.', editTitle: 'Hosts', fields: { diff --git a/lib/ui/static/js/lists/Inventories.js b/lib/ui/static/js/lists/Inventories.js index e4edb30578..a51d32b4ea 100644 --- a/lib/ui/static/js/lists/Inventories.js +++ b/lib/ui/static/js/lists/Inventories.js @@ -14,7 +14,7 @@ angular.module('InventoriesListDefinition', []) iterator: 'inventory', selectTitle: 'Add Inventories', editTitle: 'Inventories', - selectInstructions: 'Check the Select checkbox next to each inventory to be added, and click Finished when done. Use the green button to create a new inventory.', + selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green button to create a new row.', fields: { name: { diff --git a/lib/ui/static/js/lists/Projects.js b/lib/ui/static/js/lists/Projects.js index 2ac0f48871..e6efb0f168 100644 --- a/lib/ui/static/js/lists/Projects.js +++ b/lib/ui/static/js/lists/Projects.js @@ -14,7 +14,7 @@ angular.module('ProjectsListDefinition', []) iterator: 'project', selectTitle: 'Add Project', editTitle: '{{ name }}', - selectInstructions: 'Check the Select checkbox next to each project to be added, and click Finished when done. Use the green button to create a new project.', + selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green button to create a new row.', fields: { name: { diff --git a/lib/ui/static/lib/ansible/list-generator.js b/lib/ui/static/lib/ansible/list-generator.js index 1a28851f24..53205bb199 100644 --- a/lib/ui/static/lib/ansible/list-generator.js +++ b/lib/ui/static/lib/ansible/list-generator.js @@ -169,9 +169,9 @@ angular.module('ListGenerator', ['GeneratorHelpers',]) // table body html += "
\n"; html += "