diff --git a/awx/ui/static/js/controllers/Credentials.js b/awx/ui/static/js/controllers/Credentials.js index d9b7f83019..6fd3cf50e7 100644 --- a/awx/ui/static/js/controllers/Credentials.js +++ b/awx/ui/static/js/controllers/Credentials.js @@ -159,7 +159,8 @@ function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $routePar form: form, current_item: (!Empty($routeParams.user_id)) ? $routeParams.user_id : null, list: UserList, - field: 'user' + field: 'user', + input_type: 'radio' }); LookUpInit({ @@ -314,7 +315,8 @@ function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routePa form: form, current_item: (!Empty($scope.user_id)) ? $scope.user_id : null, list: UserList, - field: 'user' + field: 'user', + input_type: 'radio' }); LookUpInit({ diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index 1f6f7936e6..230c470a24 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -400,7 +400,8 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routePar form: form, current_item: ($routeParams.organization_id) ? $routeParams.organization_id : null, list: OrganizationList, - field: 'organization' + field: 'organization', + input_type: 'radio' }); // Save diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index c3f0bf919c..17c074aa70 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -161,7 +161,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa form: form, current_item: null, list: InventoryList, - field: 'inventory' + field: 'inventory', + input_type: "radio" }); // Clone the CredentialList object for use with cloud_credential. Cloning @@ -177,7 +178,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa current_item: null, list: CloudCredentialList, field: 'cloud_credential', - hdr: 'Select Cloud Credential' + hdr: 'Select Cloud Credential', + input_type: 'radio' }); LookUpInit({ @@ -187,7 +189,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa current_item: null, list: CredentialList, field: 'credential', - hdr: 'Select Machine Credential' + hdr: 'Select Machine Credential', + input_type: "radio" }); // Update playbook select whenever project value changes @@ -262,7 +265,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa form: form, current_item: null, list: ProjectList, - field: 'project' + field: 'project', + input_type: "radio" }); function saveCompleted() { @@ -535,7 +539,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP current_item: $scope.cloud_credential, list: CloudCredentialList, field: 'cloud_credential', - hdr: 'Select Cloud Credential' + hdr: 'Select Cloud Credential', + input_type: "radio" }); $scope.$emit('jobTemplateLoadFinished'); }); @@ -639,7 +644,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP form: form, current_item: data.inventory, list: InventoryList, - field: 'inventory' + field: 'inventory', + input_type: "radio" }); LookUpInit({ @@ -649,7 +655,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP current_item: data.credential, list: CredentialList, field: 'credential', - hdr: 'Select Machine Credential' + hdr: 'Select Machine Credential', + input_type: "radio" }); LookUpInit({ @@ -657,7 +664,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP form: form, current_item: data.project, list: ProjectList, - field: 'project' + field: 'project', + input_type: "radio" }); RelatedSearchInit({ diff --git a/awx/ui/static/js/controllers/Permissions.js b/awx/ui/static/js/controllers/Permissions.js index cf674ec0cb..cda7dc49ca 100644 --- a/awx/ui/static/js/controllers/Permissions.js +++ b/awx/ui/static/js/controllers/Permissions.js @@ -129,7 +129,8 @@ function PermissionsAdd($scope, $rootScope, $compile, $location, $log, $routePar form: form, current_item: null, list: InventoryList, - field: 'inventory' + field: 'inventory', + input_type: 'radio' }); LookUpInit({ @@ -249,7 +250,8 @@ function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $routePa form: form, current_item: data.inventory, list: InventoryList, - field: 'inventory' + field: 'inventory', + input_type: "radio" }); LookUpInit({ diff --git a/awx/ui/static/js/controllers/Projects.js b/awx/ui/static/js/controllers/Projects.js index 17ba9c7f9d..781e8d07dc 100644 --- a/awx/ui/static/js/controllers/Projects.js +++ b/awx/ui/static/js/controllers/Projects.js @@ -434,7 +434,8 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams scope: $scope, form: form, list: OrganizationList, - field: 'organization' + field: 'organization', + input_type: 'radio' }); LookUpInit({ @@ -442,7 +443,8 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams url: GetBasePath('credentials') + '?kind=scm', form: form, list: CredentialList, - field: 'credential' + field: 'credential', + input_type: "radio" }); // Save @@ -545,7 +547,11 @@ function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParam relatedSets = {}; SchedulesList.well = false; - generator.inject(form, { mode: 'edit', related: true, scope: $scope }); + generator.inject(form, { + mode: 'edit', + related: true, + scope: $scope + }); generator.reset(); $scope.project_local_paths = []; @@ -597,7 +603,8 @@ function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParam scope: $scope, form: form, list: CredentialList, - field: 'credential' + field: 'credential', + input_type: 'radio' }); $scope.pathRequired = ($scope.scm_type.value === '') ? true : false; diff --git a/awx/ui/static/js/controllers/Teams.js b/awx/ui/static/js/controllers/Teams.js index 01353d9a8c..4faf69139d 100644 --- a/awx/ui/static/js/controllers/Teams.js +++ b/awx/ui/static/js/controllers/Teams.js @@ -7,13 +7,13 @@ * Controller functions for the Team model. * */ - + 'use strict'; function TeamsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, TeamList, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait, Stream) { - + ClearScope(); var list = TeamList, @@ -22,7 +22,7 @@ function TeamsList($scope, $rootScope, $location, $log, $routeParams, Rest, Aler paths = $location.path().replace(/^\//, '').split('/'), mode = (paths[0] === 'teams') ? 'edit' : 'select', url; - + generator.inject(list, { mode: mode, scope: $scope }); $scope.selected = []; @@ -121,7 +121,7 @@ function TeamsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, T form = TeamForm, generator = GenerateForm, scope = generator.inject(form, { mode: 'add', related: false }); - + $rootScope.flashMessage = null; generator.reset(); LoadBreadCrumbs(); @@ -131,7 +131,8 @@ function TeamsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, T form: form, current_item: null, list: OrganizationList, - field: 'organization' + field: 'organization', + input_type: 'radio' }); // Save @@ -173,7 +174,7 @@ TeamsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$r function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, TeamForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt, GetBasePath, CheckAccess, OrganizationList, Wait, Stream) { - + ClearScope(); var defaultUrl = GetBasePath('teams'), @@ -253,7 +254,8 @@ function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, form: form, current_item: data.organization, list: OrganizationList, - field: 'organization' + field: 'organization', + input_type: 'radio' }); $scope.organization_url = data.related.organization; diff --git a/awx/ui/static/js/controllers/Users.js b/awx/ui/static/js/controllers/Users.js index 444f507b48..4ba542b962 100644 --- a/awx/ui/static/js/controllers/Users.js +++ b/awx/ui/static/js/controllers/Users.js @@ -129,7 +129,8 @@ function UsersAdd($scope, $rootScope, $compile, $location, $log, $routeParams, U form: form, current_item: ($routeParams.organization_id !== undefined) ? $routeParams.organization_id : null, list: OrganizationList, - field: 'organization' + field: 'organization', + input_type: 'radio' }); if ($routeParams.organization_id) { diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 6fe61322b5..ea2b67689f 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -260,7 +260,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' scope: scope, form: form, list: CredentialList, - field: 'credential' + field: 'credential', + input_type: "radio" }); if ($('#group_tabs .active a').text() === 'Source' && scope.source.value === 'ec2') { callback = function(){ Wait('stop'); }; diff --git a/awx/ui/static/js/helpers/Lookup.js b/awx/ui/static/js/helpers/Lookup.js index c06e0b0e22..041f8c04a5 100644 --- a/awx/ui/static/js/helpers/Lookup.js +++ b/awx/ui/static/js/helpers/Lookup.js @@ -13,6 +13,7 @@ * hdr: * postAction: optional function to run after selection made, * callback: optional label to $emit() on parent scope + * input_type: optional string that specifies whether lookup should have checkboxes or radio buttons. defaults to 'checkbox' --- added by JT 8/21/14 * }) */ @@ -31,6 +32,7 @@ angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'Pa instructions = params.instructions, postAction = params.postAction, callback = params.callback, + input_type = (params.input_type) ? params.input_type: "checkbox", defaultUrl, name, watchUrl; if (params.url) { @@ -72,7 +74,8 @@ angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'Pa mode: 'lookup', id: 'lookup-modal-dialog', scope: scope, - instructions: instructions + instructions: instructions, + input_type: input_type }); name = list.iterator.charAt(0).toUpperCase() + list.iterator.substring(1); diff --git a/awx/ui/static/lib/ansible/list-generator.js b/awx/ui/static/lib/ansible/list-generator.js index b2ce5da407..5fcf8c2a13 100644 --- a/awx/ui/static/lib/ansible/list-generator.js +++ b/awx/ui/static/lib/ansible/list-generator.js @@ -331,12 +331,12 @@ angular.module('ListGenerator', ['GeneratorHelpers']) } if (options.mode === 'select' || options.mode === 'lookup') { - if(list.iterator==='organization'){ + if(options.input_type==="radio"){ //added by JT so that lookup forms can be either radio inputs or check box inputs html += ""; } - else + else // its assumed that options.input_type = checkbox html += "";