diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 741e654c99..5ce29fbe1c 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -490,9 +490,9 @@ input[type='radio']:checked:before { .FormToggle {} .FormToggle-container { - float: right; margin: 0 0 0 10px; padding-bottom: 5px; + display: initial; label { &:first-child { @@ -513,6 +513,16 @@ input[type='radio']:checked:before { } } +.Form-inputLabelContainer { + width: 100%; + display: block !important; +} + +.Form-inputLabelContainer[for=variables] { + width: 100%; + display: inline-block !important; +} + .Form-inputLabel{ text-transform: uppercase; color: @default-interface-txt; @@ -614,6 +624,10 @@ input[type='radio']:checked:before { max-width: 100% !important; } +.Form-checkbox { + float: right; +} + .Form-subCheckbox { margin-top: 5px; font-size: small; diff --git a/awx/ui/client/src/shared/Utilities.js b/awx/ui/client/src/shared/Utilities.js index 3d3646e64d..0b7a86970f 100644 --- a/awx/ui/client/src/shared/Utilities.js +++ b/awx/ui/client/src/shared/Utilities.js @@ -665,6 +665,10 @@ angular.module('Utilities', ['RestServices', 'Utilities']) // Don't toggle the dropdown when a multiselect option is // being removed if (multiple) { + if (params.disabledOptions) { + $(element).on('select2:selecting', e => e.preventDefault()); + } + $(element).on('select2:opening', (e) => { var unselecting = $(e.target).data('select2-unselecting'); if (unselecting === true) { diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 25a28db1d5..70e515f3a5 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -639,7 +639,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat return html; } - function label() { + function label(options) { var html = ''; if (field.label || field.labelBind) { html += "\n"; } + return html; } @@ -770,7 +775,21 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat //text fields if (field.type === 'text' || field.type === 'password' || field.type === 'email') { - html += label(); + let labelOptions = {}; + + if (field.subCheckbox) { + labelOptions.checkbox = { + id: `${this.form.name}_${fld}_ask_chbox`, + ngShow: field.subCheckbox.ngShow, + ngChange: field.subCheckbox.ngChange, + ngModel: field.subCheckbox.variable, + ngDisabled: field.ngDisabled, + text: field.subCheckbox.text || '' + }; + } + + html += label(labelOptions); + html += "
\n
\n"; } - if (field.subCheckbox) { - html += "