diff --git a/awx/ui/static/js/forms/Inventories.js b/awx/ui/static/js/forms/Inventories.js index 4e9d59e47d..7705ad4282 100644 --- a/awx/ui/static/js/forms/Inventories.js +++ b/awx/ui/static/js/forms/Inventories.js @@ -50,8 +50,6 @@ angular.module('InventoryFormDefinition', []) type: 'lookup', sourceModel: 'organization', sourceField: 'name', - addRequired: true, - editRequired: true, ngClick: 'lookUpOrganization()', awRequiredWhen: {variable: "organizationrequired", init: "true" } }, diff --git a/awx/ui/static/js/forms/InventoryHosts.js b/awx/ui/static/js/forms/InventoryHosts.js index 590bd8913f..eea53a202f 100644 --- a/awx/ui/static/js/forms/InventoryHosts.js +++ b/awx/ui/static/js/forms/InventoryHosts.js @@ -54,21 +54,21 @@ angular.module('InventoryHostsFormDefinition', []) actions: { add: { - label: 'Add Existing Host', + label: 'Copy', ngClick: "addHost()", ngHide: "hostAddHide", - awToolTip: "Select from a list of existing hosts", + awToolTip: "Copy an existing host to the selected group", dataPlacement: 'bottom', - 'class': 'btn-xs btn-primary', + 'class': 'btn-sm btn-primary', icon: 'icon-check' }, create: { - label: 'Create New Host', + label: 'Create New', ngClick: 'createHost()', ngHide: 'hostCreateHide', - awToolTip: 'Create a new host', + awToolTip: 'Create a new host and add it to the selected group', dataPlacement: 'bottom', - 'class': 'btn-xs btn-success', + 'class': 'btn-sm btn-success', icon: 'icon-plus' } }, diff --git a/awx/ui/static/js/forms/Teams.js b/awx/ui/static/js/forms/Teams.js index 79bf981c1a..19430dd042 100644 --- a/awx/ui/static/js/forms/Teams.js +++ b/awx/ui/static/js/forms/Teams.js @@ -38,8 +38,6 @@ angular.module('TeamFormDefinition', []) type: 'lookup', sourceModel: 'organization', sourceField: 'name', - addRequired: true, - editRequired: true, ngClick: 'lookUpOrganization()', awRequiredWhen: {variable: "teamrequired", init: "true" } } diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 0f43c4470a..6a71bf06af 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -25,6 +25,7 @@ body { /* Helper Classes */ .pad-right-sm { padding-right: 10px; } +.pad-left-lg { padding-left: 50px; } .spinny { display: none; @@ -633,6 +634,7 @@ select.field-mini-height { .title { display: inline-block; + padding-top: 7px; color: #555; font-size: 14px; font-weight: normal; diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index c3beba37d0..e3539e4b64 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -110,9 +110,18 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos validity = true; if ( scope[attrs.awRequiredWhen] && (elm.attr('required') == null || elm.attr('required') == undefined) ) { $(elm).attr('required','required'); + console.log('here'); + if ($(elm).hasClass('lookup')) { + console.log('adding!'); + $(elm).parent().parent().parent().find('label').prepend('* '); + } } else if (!scope[attrs.awRequiredWhen]) { - elm.removeAttr('required'); + elm.removeAttr('required'); + if ($(elm).hasClass('lookup')) { + var txt = $(elm).parent().parent().parent().find('label').text(); + $(elm).parent().parent().parent().find('label').text(txt.replace(/^*/,'')); + } } if (scope[attrs.awRequiredWhen] && (viewValue == undefined || viewValue == null || viewValue == '')) { validity = false; diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index f6826c8ee9..0c0adc8e12 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -88,6 +88,11 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) $(this).remove(); }); + // Prepend an asterisk to required field label + $('.form-control[required]').each(function() { + var txt = $(this).parent().parent().find('label').prepend('* '); + }); + if (options.modal) { this.scope.formModalActionDisabled = false; this.scope.formModalInfo = false //Disable info button for default modal @@ -680,7 +685,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) html += "\n"; html += "\n"; html += "\n"; - html += " " + // "Inventory Properties\n"; - html += "\n"; //html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; html += "\n"; @@ -1095,7 +1100,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) html += "