mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
AC-280, AC-289 Fixes
This commit is contained in:
@@ -231,7 +231,7 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
$('input[type="checkbox"]').attr('disabled','disabled');
|
$('input[type="checkbox"]').attr('disabled','disabled');
|
||||||
$('input[type="radio"]').attr('disabled','disabled');
|
$('input[type="radio"]').attr('disabled','disabled');
|
||||||
$('#host_config_key-gen-btn').attr('disabled','disabled');
|
$('#host_config_key-gen-btn').attr('disabled','disabled');
|
||||||
$('textarea').attr('disabled','disabled');
|
$('textarea').attr('readonly','readonly');
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
ProcessErrors(scope, data, status, form,
|
ProcessErrors(scope, data, status, form,
|
||||||
|
|||||||
@@ -24,13 +24,14 @@ angular.module('SelectionHelper', ['Utilities', 'RestServices'])
|
|||||||
scope.selected = []; //array of selected row IDs
|
scope.selected = []; //array of selected row IDs
|
||||||
|
|
||||||
// toggle row selection
|
// toggle row selection
|
||||||
scope['toggle_' + list.iterator] = function(id) {
|
scope['toggle_' + list.iterator] = function(id, ischeckbox) {
|
||||||
for (var i=0; i < scope[list.name].length; i++) {
|
for (var i=0; i < scope[list.name].length; i++) {
|
||||||
if (scope[list.name][i]['id'] == id) {
|
if (scope[list.name][i]['id'] == id) {
|
||||||
if (scope[list.name][i]['checked'] == '0') {
|
if ( (scope[list.name][i]['checked'] == '0' && !ischeckbox) || (scope[list.name][i]['checked'] == 1 && ischeckbox) ) {
|
||||||
// select the row
|
// select the row
|
||||||
scope[list.name][i]['checked'] = '1';
|
scope[list.name][i]['checked'] = '1';
|
||||||
scope[list.name][i]['success_class'] = 'success';
|
scope[list.name][i]['success_class'] = 'success';
|
||||||
|
|
||||||
// add selected object to the array
|
// add selected object to the array
|
||||||
var found = false;
|
var found = false;
|
||||||
for (var j=0; j < scope.selected.length; j++) {
|
for (var j=0; j < scope.selected.length; j++) {
|
||||||
@@ -47,6 +48,7 @@ angular.module('SelectionHelper', ['Utilities', 'RestServices'])
|
|||||||
// unselect the row
|
// unselect the row
|
||||||
scope[list.name][i]['checked'] = '0';
|
scope[list.name][i]['checked'] = '0';
|
||||||
scope[list.name][i]['success_class'] = '';
|
scope[list.name][i]['success_class'] = '';
|
||||||
|
|
||||||
// remove selected object from the array
|
// remove selected object from the array
|
||||||
for (var j=0; j < scope.selected.length; j++) {
|
for (var j=0; j < scope.selected.length; j++) {
|
||||||
if (scope.selected[j].id == id) {
|
if (scope.selected[j].id == id) {
|
||||||
|
|||||||
@@ -101,12 +101,13 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
|||||||
var field = list['fields'][fld];
|
var field = list['fields'][fld];
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
html += "<td ";
|
//html += "<td ";
|
||||||
html += "<td class=\"" + fld + "-column";
|
html += "<td class=\"" + fld + "-column";
|
||||||
html += (field['class']) ? " " + field['class'] : "";
|
html += (field['class']) ? " " + field['class'] : "";
|
||||||
html += (field['columnClass']) ? " " + field['columnClass'] : "";
|
html += (field['columnClass']) ? " " + field['columnClass'] : "";
|
||||||
html += "\" ";
|
html += "\" ";
|
||||||
html += (field.ngClass) ? Attr(field, 'ngClass') : "";
|
html += (field.ngClass) ? Attr(field, 'ngClass') : "";
|
||||||
|
html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
|
|
||||||
// Add ngShow
|
// Add ngShow
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
|||||||
html += (list.orderBy) ? " | orderBy:'" + list.orderBy + "'" : "";
|
html += (list.orderBy) ? " | orderBy:'" + list.orderBy + "'" : "";
|
||||||
html += (list.filterBy) ? " | filter: " + list.filterBy : "";
|
html += (list.filterBy) ? " | filter: " + list.filterBy : "";
|
||||||
html += "\"";
|
html += "\"";
|
||||||
html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
|
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
if (list.index) {
|
if (list.index) {
|
||||||
html += "<td class=\"index-column\">{{ $index + (" + list.iterator + "Page * " + list.iterator + "PageSize) + 1 }}.</td>\n";
|
html += "<td class=\"index-column\">{{ $index + (" + list.iterator + "Page * " + list.iterator + "PageSize) + 1 }}.</td>\n";
|
||||||
@@ -237,13 +236,9 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.mode == 'select' || options.mode == 'lookup') {
|
if (options.mode == 'select' || options.mode == 'lookup') {
|
||||||
//html += "<td><input type=\"checkbox\" name=\"check_{{" + list.iterator + ".id }}\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
|
||||||
|
|
||||||
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
||||||
list.iterator + ".id }}\" ng-true-value=\"1\" ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }}, true)\" ng-true-value=\"1\" " +
|
||||||
|
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
||||||
//ng-click=\"toggle_" + list.iterator +
|
|
||||||
// "({{ " + list.iterator + ".id }}, true)\"
|
|
||||||
}
|
}
|
||||||
else if (options.mode == 'edit') {
|
else if (options.mode == 'edit') {
|
||||||
// Row level actions
|
// Row level actions
|
||||||
|
|||||||
Reference in New Issue
Block a user