1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 18:21:12 +03:00

AC-378 fixed broken pop-over. Using 'esc' to close now workd correctly.

This commit is contained in:
chouseknecht 2013-09-01 17:34:36 -04:00
parent 51333c0a8a
commit 503cdced2f
5 changed files with 26 additions and 19 deletions

View File

@ -103,12 +103,14 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
generator.reset();
LoadBreadCrumbs();
GetProjectPath({ scope: scope, master: master });
//console.log(scope.)
scope.scm_type = null;
master.scm_type = null;
scope.scm_type_options = [
{ label: 'GitHub', value: 'git' },
{ label: 'SVN', value: 'svn' }];
{ label: 'Git', value: 'git' },
{ label: 'SVN', value: 'svn' },
{ label: 'Mercurial', value: 'hg'}];
LookUpInit({
scope: scope,
@ -201,8 +203,9 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
var relatedSets = {};
scope.scm_type_options = [
{ label: 'GitHub', value: 'git' },
{ label: 'SVN', value: 'svn' }];
{ label: 'Git', value: 'git' },
{ label: 'SVN', value: 'svn' },
{ label: 'Mercurial', value: 'hg'}];
scope.project_local_paths = [];
scope.base_dir = '';

View File

@ -46,11 +46,21 @@ angular.module('ProjectFormDefinition', [])
dataContainer: 'body',
dataPlacement: 'right'
},
scm_type: {
label: 'SCM Type',
type: 'select',
ngOptions: 'type.label for type in scm_type_options',
ngChange: 'scmChange()',
defaultOption: 'Manual',
addRequired: false,
editRequired: false
},
base_dir: {
label: 'Project Base Path',
type: 'textarea',
"class": 'col-lg-6',
showonly: true,
ngShow: "scm_type == '' || scm_type == null",
awPopOver: '<p>Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. ' +
'Together the base path and selected playbook directory provide the full path used to locate playbooks.</p>' +
'<p>Use PROJECTS_ROOT in your environment settings file to determine the base path value.</p>',
@ -58,15 +68,6 @@ angular.module('ProjectFormDefinition', [])
dataContainer: 'body',
dataPlacement: 'right'
},
scm_type: {
label: 'SCM Type',
type: 'select',
ngOptions: 'type.label for type in scm_type_options',
ngChange: 'scmChange()',
"default": '',
addRequired: false,
editRequired: false
},
local_path: {
label: 'Playbook Directory',
type: 'select',

View File

@ -31,6 +31,7 @@ angular.module('ProjectPathHelper', ['RestServices', 'Utilities'])
scope.base_dir = data.project_base_dir;
master.base_dir = scope.base_dir; // Keep in master object so that it doesn't get
// wiped out on form reset.
console.log('base_dir: ' + scope.base_dir);
if (opts.length == 0) {
Alert('Missing Playbooks',
'<p>There are no unassigned playbook directories in the base project path (' + scope.base_dir + '). ' +

View File

@ -231,10 +231,10 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos
});
$(document).bind('keydown', function(e) {
if (e.keyCode === 27) {
$(element).popover('destroy');
$('.popover').each(function(index) {
$(element).popover('hide');
$('.popover').each(function(index) {
// remove lingering popover <div>. Seems to be a bug in TB3 RC1
$(this).remove();
$(this).remove();
});
}
});

View File

@ -490,8 +490,10 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += (field.readonly) ? "readonly " : "";
html += (field.awRequiredWhen) ? "data-awrequired-init=\"" + field.awRequiredWhen.init + "\" aw-required-when=\"" +
field.awRequiredWhen.variable + "\" " : "";
html += ">\n";
html += "<option value=\"\">Choose " + field.label + "</option>\n";
html += ">\n";
html += "<option value=\"\">";
html += (field.defaultOption) ? field.defaultOption : "Choose " + field.label;
html += "</option>\n";
html += "</select>\n";
// Add error messages
if ( (options.mode == 'add' && field.addRequired) || (options.mode == 'edit' && field.editRequired) ) {