diff --git a/awx/ui/static/js/forms/Organizations.js b/awx/ui/static/js/forms/Organizations.js index e0cc15b405..ff4a183e63 100644 --- a/awx/ui/static/js/forms/Organizations.js +++ b/awx/ui/static/js/forms/Organizations.js @@ -21,7 +21,7 @@ angular.module('OrganizationFormDefinition', []) type: 'text', addRequired: true, editRequired: true, - capitalize: true + capitalize: false }, description: { label: 'Description', diff --git a/awx/ui/static/js/forms/Permissions.js b/awx/ui/static/js/forms/Permissions.js index 0fe40d6c99..0a6bea2c1f 100644 --- a/awx/ui/static/js/forms/Permissions.js +++ b/awx/ui/static/js/forms/Permissions.js @@ -28,7 +28,7 @@ angular.module('PermissionFormDefinition', []) type: 'text', addRequired: true, editRequired: true, - capitalize: true + capitalize: false }, description: { label: 'Description', diff --git a/awx/ui/static/js/forms/Projects.js b/awx/ui/static/js/forms/Projects.js index 274ebb48e2..549153e586 100644 --- a/awx/ui/static/js/forms/Projects.js +++ b/awx/ui/static/js/forms/Projects.js @@ -22,7 +22,7 @@ angular.module('ProjectFormDefinition', []) type: 'text', addRequired: true, editRequired: true, - capitalize: true + capitalize: false }, description: { label: 'Description', @@ -96,16 +96,29 @@ angular.module('ProjectFormDefinition', []) label: 'SCM URL', type: 'text', ngShow: "scm_type !== '' && scm_type !== null", - //awValidUrl: 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'*/ + awRequiredWhen: { variable: "scm_type", init: "true" }, + helpCollapse: [ + { hdr: 'GIT URLs', + content: 'Example URLs for GIT SCM include:
Note: If using SSH protocol for github or bitbucket, enter in the SSH key only, ' + + 'do not enter a username (other than git) and password authentication is not supported. GIT read only ' + + 'protocol (git://) does not use username or password information.', + show: "scm_type.value == 'git'" }, + { hdr: 'SVN URLs', + content: '
Example URLs for Subversion SCM include:
' + + 'Example URLs for Mercurial SCM include:
' + + 'Note: Mercurial does not support password authentication for SSH. ' + + 'If applicable, add the username, password and key below. Do not put the username and key in the URL. ' + + 'If using Bitbucket and SSH, do not supply your Bitbucket username.', + show: "scm_type.value == 'hg'" } + ] }, scm_branch: { labelBind: "scmBranchLabel", diff --git a/awx/ui/static/js/forms/Teams.js b/awx/ui/static/js/forms/Teams.js index f791d3449e..d2ae7d2696 100644 --- a/awx/ui/static/js/forms/Teams.js +++ b/awx/ui/static/js/forms/Teams.js @@ -25,7 +25,7 @@ angular.module('TeamFormDefinition', []) type: 'text', addRequired: true, editRequired: true, - capitalize: true + capitalize: false }, description: { label: 'Description', diff --git a/awx/ui/static/js/forms/Users.js b/awx/ui/static/js/forms/Users.js index ccbafe2993..25cbf7a86e 100644 --- a/awx/ui/static/js/forms/Users.js +++ b/awx/ui/static/js/forms/Users.js @@ -14,10 +14,11 @@ angular.module('UserFormDefinition', []) editTitle: '{{ username }}', //Legend in edit mode name: 'user', //Form name attribute well: true, //Wrap the form with TB well - collapse: true, + /*collapse: true, collapseTitle: 'User Settings', collapseMode: 'edit', - collapseOpen: true, + collapseOpen: true,*/ + forceListeners: true, fields: { first_name: { diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 6eb88905aa..531c5ef7f9 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -27,6 +27,7 @@ body { .pad-right-sm { padding-right: 10px; } .pad-left-lg { padding-left: 50px; } .normal-weight { font-weight: normal; } +.no-bullets { list-style: none; } /* Working... spinner */ .spinny { @@ -90,6 +91,19 @@ hr { white-space: nowrap; } +/* help collapse */ +h4.panel-title { + font-size: 14px; +} + +.panel-heading:hover { + cursor: pointer; +} + +.panel-default>.panel-heading .collapse-help-icon { + color: @grey; +} + th.actions-column, td.actions { white-space: nowrap; diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 02099a299e..fe7fae4f64 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -10,8 +10,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) .factory('GenerateForm', [ '$location', '$cookieStore', '$compile', 'SearchWidget', 'PaginateWidget', 'Attr', 'Icon', 'Column', - 'NavigationLink', - function($location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column, NavigationLink) { + 'NavigationLink', 'HelpCollapse', + function($location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column, NavigationLink, HelpCollapse) { return { setForm: function(form) { @@ -22,6 +22,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) icon: Icon, + accordion_count: 0, + has: function(key) { return (this.form[key] && this.form[key] != null && this.form[key] != undefined) ? true : false; }, @@ -197,6 +199,16 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) }); } else { + this.scope.accordionToggle = function(selector) { + $(selector).collapse('toggle'); + if ( $(selector + '-icon').hasClass('icon-minus') ) { + $(selector + '-icon').removeClass('icon-minus').addClass('icon-plus'); + } + else { + $(selector + '-icon').removeClass('icon-plus').addClass('icon-minus') + } + } + $('.jqui-accordion').each( function(index) { var active = false; @@ -289,6 +301,21 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) navigationLink: NavigationLink, + + buildHelpCollapse: function(collapse_array) { + var html = ''; + var params = {}; + for (var i=0; i < collapse_array.length; i++) { + params.hdr = collapse_array[i].hdr; + params.content = collapse_array[i].content; + params.idx = this.accordion_count++; + params.show = (collapse_array[i].show) ? collapse_array[i].show : null; + html += HelpCollapse(params); + } + return html; + }, + + buildField: function(fld, field, options, form) { function getFieldWidth() { @@ -326,7 +353,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) x = "col-lg-2"; } return x; - } + } function buildCheckbox(field, fld) { var html=''; @@ -348,7 +375,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) html += (field.awPopOver) ? Attr(field, 'awPopOver', fld) : ""; html += "\n"; return html; - } + } var html = ''; @@ -456,36 +483,45 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) html += "
A password with reasonable strength is required. As you type the password " + - "a progress bar will measure the strength. Sufficient strength is reached when the bar turns green.
" + - "Password strength is judged using the following:
"; - html += "A password with reasonable strength is required. As you type the password " + + "a progress bar will measure the strength. Sufficient strength is reached when the bar turns green.
" + + "Password strength is judged using the following:
" + + "