mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 12:27:37 -02:30
changed some lookup dialogs to use radio buttons
This commit is contained in:
@@ -159,7 +159,8 @@ function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: (!Empty($routeParams.user_id)) ? $routeParams.user_id : null,
|
current_item: (!Empty($routeParams.user_id)) ? $routeParams.user_id : null,
|
||||||
list: UserList,
|
list: UserList,
|
||||||
field: 'user'
|
field: 'user',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
@@ -314,7 +315,8 @@ function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: (!Empty($scope.user_id)) ? $scope.user_id : null,
|
current_item: (!Empty($scope.user_id)) ? $scope.user_id : null,
|
||||||
list: UserList,
|
list: UserList,
|
||||||
field: 'user'
|
field: 'user',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
|
|||||||
@@ -400,7 +400,8 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: ($routeParams.organization_id) ? $routeParams.organization_id : null,
|
current_item: ($routeParams.organization_id) ? $routeParams.organization_id : null,
|
||||||
list: OrganizationList,
|
list: OrganizationList,
|
||||||
field: 'organization'
|
field: 'organization',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
|
|||||||
@@ -161,7 +161,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: null,
|
current_item: null,
|
||||||
list: InventoryList,
|
list: InventoryList,
|
||||||
field: 'inventory'
|
field: 'inventory',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Clone the CredentialList object for use with cloud_credential. Cloning
|
// 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,
|
current_item: null,
|
||||||
list: CloudCredentialList,
|
list: CloudCredentialList,
|
||||||
field: 'cloud_credential',
|
field: 'cloud_credential',
|
||||||
hdr: 'Select Cloud Credential'
|
hdr: 'Select Cloud Credential',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
@@ -187,7 +189,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
current_item: null,
|
current_item: null,
|
||||||
list: CredentialList,
|
list: CredentialList,
|
||||||
field: 'credential',
|
field: 'credential',
|
||||||
hdr: 'Select Machine Credential'
|
hdr: 'Select Machine Credential',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update playbook select whenever project value changes
|
// Update playbook select whenever project value changes
|
||||||
@@ -262,7 +265,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: null,
|
current_item: null,
|
||||||
list: ProjectList,
|
list: ProjectList,
|
||||||
field: 'project'
|
field: 'project',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
function saveCompleted() {
|
function saveCompleted() {
|
||||||
@@ -535,7 +539,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
current_item: $scope.cloud_credential,
|
current_item: $scope.cloud_credential,
|
||||||
list: CloudCredentialList,
|
list: CloudCredentialList,
|
||||||
field: 'cloud_credential',
|
field: 'cloud_credential',
|
||||||
hdr: 'Select Cloud Credential'
|
hdr: 'Select Cloud Credential',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
$scope.$emit('jobTemplateLoadFinished');
|
$scope.$emit('jobTemplateLoadFinished');
|
||||||
});
|
});
|
||||||
@@ -639,7 +644,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: data.inventory,
|
current_item: data.inventory,
|
||||||
list: InventoryList,
|
list: InventoryList,
|
||||||
field: 'inventory'
|
field: 'inventory',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
@@ -649,7 +655,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
current_item: data.credential,
|
current_item: data.credential,
|
||||||
list: CredentialList,
|
list: CredentialList,
|
||||||
field: 'credential',
|
field: 'credential',
|
||||||
hdr: 'Select Machine Credential'
|
hdr: 'Select Machine Credential',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
@@ -657,7 +664,8 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: data.project,
|
current_item: data.project,
|
||||||
list: ProjectList,
|
list: ProjectList,
|
||||||
field: 'project'
|
field: 'project',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
RelatedSearchInit({
|
RelatedSearchInit({
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ function PermissionsAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: null,
|
current_item: null,
|
||||||
list: InventoryList,
|
list: InventoryList,
|
||||||
field: 'inventory'
|
field: 'inventory',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
@@ -249,7 +250,8 @@ function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: data.inventory,
|
current_item: data.inventory,
|
||||||
list: InventoryList,
|
list: InventoryList,
|
||||||
field: 'inventory'
|
field: 'inventory',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
|
|||||||
@@ -434,7 +434,8 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams
|
|||||||
scope: $scope,
|
scope: $scope,
|
||||||
form: form,
|
form: form,
|
||||||
list: OrganizationList,
|
list: OrganizationList,
|
||||||
field: 'organization'
|
field: 'organization',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
@@ -442,7 +443,8 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams
|
|||||||
url: GetBasePath('credentials') + '?kind=scm',
|
url: GetBasePath('credentials') + '?kind=scm',
|
||||||
form: form,
|
form: form,
|
||||||
list: CredentialList,
|
list: CredentialList,
|
||||||
field: 'credential'
|
field: 'credential',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
@@ -545,7 +547,11 @@ function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
SchedulesList.well = false;
|
SchedulesList.well = false;
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, {
|
||||||
|
mode: 'edit',
|
||||||
|
related: true,
|
||||||
|
scope: $scope
|
||||||
|
});
|
||||||
generator.reset();
|
generator.reset();
|
||||||
|
|
||||||
$scope.project_local_paths = [];
|
$scope.project_local_paths = [];
|
||||||
@@ -597,7 +603,8 @@ function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
scope: $scope,
|
scope: $scope,
|
||||||
form: form,
|
form: form,
|
||||||
list: CredentialList,
|
list: CredentialList,
|
||||||
field: 'credential'
|
field: 'credential',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.pathRequired = ($scope.scm_type.value === '') ? true : false;
|
$scope.pathRequired = ($scope.scm_type.value === '') ? true : false;
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ function TeamsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, T
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: null,
|
current_item: null,
|
||||||
list: OrganizationList,
|
list: OrganizationList,
|
||||||
field: 'organization'
|
field: 'organization',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
@@ -253,7 +254,8 @@ function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: data.organization,
|
current_item: data.organization,
|
||||||
list: OrganizationList,
|
list: OrganizationList,
|
||||||
field: 'organization'
|
field: 'organization',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.organization_url = data.related.organization;
|
$scope.organization_url = data.related.organization;
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ function UsersAdd($scope, $rootScope, $compile, $location, $log, $routeParams, U
|
|||||||
form: form,
|
form: form,
|
||||||
current_item: ($routeParams.organization_id !== undefined) ? $routeParams.organization_id : null,
|
current_item: ($routeParams.organization_id !== undefined) ? $routeParams.organization_id : null,
|
||||||
list: OrganizationList,
|
list: OrganizationList,
|
||||||
field: 'organization'
|
field: 'organization',
|
||||||
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($routeParams.organization_id) {
|
if ($routeParams.organization_id) {
|
||||||
|
|||||||
@@ -260,7 +260,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
scope: scope,
|
scope: scope,
|
||||||
form: form,
|
form: form,
|
||||||
list: CredentialList,
|
list: CredentialList,
|
||||||
field: 'credential'
|
field: 'credential',
|
||||||
|
input_type: "radio"
|
||||||
});
|
});
|
||||||
if ($('#group_tabs .active a').text() === 'Source' && scope.source.value === 'ec2') {
|
if ($('#group_tabs .active a').text() === 'Source' && scope.source.value === 'ec2') {
|
||||||
callback = function(){ Wait('stop'); };
|
callback = function(){ Wait('stop'); };
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
* hdr: <optional. modal dialog header>
|
* hdr: <optional. modal dialog header>
|
||||||
* postAction: optional function to run after selection made,
|
* postAction: optional function to run after selection made,
|
||||||
* callback: optional label to $emit() on parent scope
|
* 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,
|
instructions = params.instructions,
|
||||||
postAction = params.postAction,
|
postAction = params.postAction,
|
||||||
callback = params.callback,
|
callback = params.callback,
|
||||||
|
input_type = (params.input_type) ? params.input_type: "checkbox",
|
||||||
defaultUrl, name, watchUrl;
|
defaultUrl, name, watchUrl;
|
||||||
|
|
||||||
if (params.url) {
|
if (params.url) {
|
||||||
@@ -72,7 +74,8 @@ angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'Pa
|
|||||||
mode: 'lookup',
|
mode: 'lookup',
|
||||||
id: 'lookup-modal-dialog',
|
id: 'lookup-modal-dialog',
|
||||||
scope: scope,
|
scope: scope,
|
||||||
instructions: instructions
|
instructions: instructions,
|
||||||
|
input_type: input_type
|
||||||
});
|
});
|
||||||
|
|
||||||
name = list.iterator.charAt(0).toUpperCase() + list.iterator.substring(1);
|
name = list.iterator.charAt(0).toUpperCase() + list.iterator.substring(1);
|
||||||
|
|||||||
@@ -331,12 +331,12 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.mode === 'select' || options.mode === 'lookup') {
|
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 += "<td><input type=\"radio\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
html += "<td><input type=\"radio\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
||||||
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-value=\"1\" " +
|
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-value=\"1\" " +
|
||||||
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
||||||
}
|
}
|
||||||
else
|
else // its assumed that options.input_type = checkbox
|
||||||
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
||||||
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-true-value=\"1\" " +
|
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-true-value=\"1\" " +
|
||||||
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
||||||
|
|||||||
Reference in New Issue
Block a user