diff --git a/awx/ui/static/js/forms/Projects.js b/awx/ui/static/js/forms/Projects.js index 73f9342c27..dab8ed4861 100644 --- a/awx/ui/static/js/forms/Projects.js +++ b/awx/ui/static/js/forms/Projects.js @@ -97,7 +97,15 @@ angular.module('ProjectFormDefinition', []) type: 'text', ngShow: "scm_type !== '' && scm_type !== null", awValidUrl: true, - awRequiredWhen: {variable: "scm_type", init: "true" } + awRequiredWhen: { variable: "scm_type", init: "true" }, + awPopOver: "
Provide the URL to your SCM server. The value should begin with the protocol https:\/\/, http:\/\/ or ssh:\/\/.
" + + "Do not inlcude username or password values. Use the authentication settings instead.
" + + "Examples include:
" + + "ssh:\/\/github.com:ansible/ansible-examples.git
" + + "https:\/\/github.com/ansible/ansible-examples.git
", + dataTitle: 'SCM URL', + dataPlacement: 'right', + dataContainer: 'body' }, scm_branch: { labelBind: "scmBranchLabel", diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 3053a4d2b2..db6c07f4e4 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -48,6 +48,10 @@ body { } } +.prepend-asterisk:before { + content: "\002A"; +} + .subtitle { font-size: 16px; } diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index 2ac004191e..640a221b61 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -112,26 +112,21 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos if ( scope[attrs.awRequiredWhen] && (elm.attr('required') == null || elm.attr('required') == undefined) ) { $(elm).attr('required','required'); if ($(elm).hasClass('lookup')) { - $(elm).parent().parent().parent().find('label').prepend('* '); + $(elm).parent().parent().parent().find('label').addClass('prepend-asterisk'); } else { - $(elm).parent().parent().find('label').prepend('* '); + $(elm).parent().parent().find('label').addClass('prepend-asterisk'); } } else if (!scope[attrs.awRequiredWhen]) { elm.removeAttr('required'); if ($(elm).hasClass('lookup')) { - txt = $(elm).parent().parent().parent().find('label').text(); label = $(elm).parent().parent().parent().find('label'); } else { - txt = $(elm).parent().parent().find('label').text(); label = $(elm).parent().parent().find('label'); } - txt = txt.replace(/^\* /,''); - if (label) { - label.text(txt); - } + label.removeClass('prepend-asterisk'); } 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 352b426e11..9cffcc49e7 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -92,10 +92,9 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) // Prepend an asterisk to required field label $('.form-control[required]').each(function() { var label = $(this).parent().parent().find('label'); - var rgx = /^\*/; - if ( !rgx.test(label.text()) ) { - // required field does not have leading * - label.prepend('* '); + if (label && !label.hasClass('prepend-asterisk')) { + console.log('adding prepend'); + label.addClass('prepend-asterisk'); } });