mirror of
https://github.com/ansible/awx.git
synced 2026-08-03 11:30:00 -02:30
All select pages now have clickable rows. The checkbox is still present and will e toggled along with row color. Fixed the typ-o on User select page.
This commit is contained in:
@@ -89,12 +89,22 @@ function AdminsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_admin = function(idx) {
|
scope.toggle_admin = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,12 +121,22 @@ function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_credential = function(idx) {
|
scope.toggle_credential = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,12 +120,22 @@ function GroupsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_group = function(idx) {
|
scope.toggle_group = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,12 +119,22 @@ function HostsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_host = function(idx) {
|
scope.toggle_host = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,12 +122,22 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_inventory = function(idx) {
|
scope.toggle_inventory = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,12 +116,22 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_credential = function(idx) {
|
scope.toggle_job_template = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,12 +116,22 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_project = function(idx) {
|
scope.toggle_project = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,12 +130,22 @@ function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Ale
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_team = function(idx) {
|
scope.toggle_team = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,12 +117,22 @@ function UsersList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.toggle_user = function(idx) {
|
scope.toggle_user = function(id) {
|
||||||
if (scope.selected.indexOf(idx) > -1) {
|
if (scope.selected.indexOf(id) > -1) {
|
||||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope.selected.push(idx);
|
scope.selected.push(id);
|
||||||
|
}
|
||||||
|
if (scope[list.iterator + "_" + id + "_class"] == "success") {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = false;
|
||||||
|
document.getElementById('check_' + id).checked = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[list.iterator + "_" + id + "_class"] = "success";
|
||||||
|
//$('input[name="check_' + id + '"]').checked = true;
|
||||||
|
document.getElementById('check_' + id).checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ angular.module('AdminListDefinition', [])
|
|||||||
iterator: 'admin',
|
iterator: 'admin',
|
||||||
selectTitle: 'Add Administrators',
|
selectTitle: 'Add Administrators',
|
||||||
editTitle: 'Admins',
|
editTitle: 'Admins',
|
||||||
selectInstructions: 'Click the Select checkbox next to each user to be added. Click the Finished button when done.',
|
selectInstructions: 'Click on a row to select it. Click the Finished button when done.',
|
||||||
base: 'users',
|
base: 'users',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ angular.module('GroupListDefinition', [])
|
|||||||
iterator: 'group',
|
iterator: 'group',
|
||||||
selectTitle: 'Add Group',
|
selectTitle: 'Add Group',
|
||||||
editTitle: 'Groups',
|
editTitle: 'Groups',
|
||||||
selectInstructions: 'Check the Select checkbox next to each group to be added, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new group.',
|
selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new row.',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ angular.module('HostListDefinition', [])
|
|||||||
name: 'hosts',
|
name: 'hosts',
|
||||||
iterator: 'host',
|
iterator: 'host',
|
||||||
selectTitle: 'Add Host',
|
selectTitle: 'Add Host',
|
||||||
selectInstructions: 'Check the Select checkbox next to each host to be added, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new host.',
|
selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new row.',
|
||||||
editTitle: 'Hosts',
|
editTitle: 'Hosts',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ angular.module('InventoriesListDefinition', [])
|
|||||||
iterator: 'inventory',
|
iterator: 'inventory',
|
||||||
selectTitle: 'Add Inventories',
|
selectTitle: 'Add Inventories',
|
||||||
editTitle: 'Inventories',
|
editTitle: 'Inventories',
|
||||||
selectInstructions: 'Check the Select checkbox next to each inventory to be added, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new inventory.',
|
selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new row.',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ angular.module('ProjectsListDefinition', [])
|
|||||||
iterator: 'project',
|
iterator: 'project',
|
||||||
selectTitle: 'Add Project',
|
selectTitle: 'Add Project',
|
||||||
editTitle: '{{ name }}',
|
editTitle: '{{ name }}',
|
||||||
selectInstructions: 'Check the Select checkbox next to each project to be added, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new project.',
|
selectInstructions: 'Click on a row to select it, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new row.',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
|
|||||||
@@ -169,9 +169,9 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
|||||||
// table body
|
// table body
|
||||||
html += "<tbody>\n";
|
html += "<tbody>\n";
|
||||||
html += "<tr ";
|
html += "<tr ";
|
||||||
html += (options.mode == 'lookup') ? "ng-class=\"" + list.iterator + "_\{\{ " + list.iterator + ".id \}\}_class\" " : "";
|
html += (options.mode == 'lookup' || options.mode == 'select') ? "ng-class=\"" + list.iterator + "_\{\{ " + list.iterator + ".id \}\}_class\" " : "";
|
||||||
html += "class=\"" + list.iterator + "_class\" ng-repeat=\"" + list.iterator + " in " + list.name + "\"";
|
html += "class=\"" + list.iterator + "_class\" ng-repeat=\"" + list.iterator + " in " + list.name + "\"";
|
||||||
html += (options.mode == 'lookup') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
|
html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
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";
|
||||||
var cnt = 2;
|
var cnt = 2;
|
||||||
@@ -180,27 +180,28 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
|||||||
cnt++;
|
cnt++;
|
||||||
if (! list.fields[fld].ngBind) {
|
if (! list.fields[fld].ngBind) {
|
||||||
html += "<td class=\"" + fld + "-column\">";
|
html += "<td class=\"" + fld + "-column\">";
|
||||||
if (list.fields[fld].key) {
|
if (list.fields[fld].key && options.mode != 'lookup') {
|
||||||
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
||||||
}
|
}
|
||||||
html += "{{" + list.iterator + "." + fld + "}}";
|
html += "{{" + list.iterator + "." + fld + "}}";
|
||||||
html += (list.fields[fld].key) ? "</a>" : "";
|
html += (list.fields[fld].key && options.mode != 'lookup') ? "</a>" : "";
|
||||||
html += "</td>\n";
|
html += "</td>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html += "<td class=\"" + fld + "-column\">";
|
html += "<td class=\"" + fld + "-column\">";
|
||||||
if (list.fields[fld].key) {
|
if (list.fields[fld].key && options.mode != 'lookup') {
|
||||||
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
||||||
}
|
}
|
||||||
html += "{{ " + list.fields[fld].ngBind + " }}";
|
html += "{{ " + list.fields[fld].ngBind + " }}";
|
||||||
html += (list.fields[fld].key) ? "</a>" : "";
|
html += (list.fields[fld].key && options.mode != 'lookup') ? "</a>" : "";
|
||||||
html += "</td>\n";
|
html += "</td>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.mode == 'select' ) {
|
if (options.mode == 'select' ) {
|
||||||
html += "<td><input type=\"checkbox\" name=\"select\" ng-click=\"toggle_" + list.iterator +
|
html += "<td><input type=\"checkbox\" name=\"check_{{" + list.iterator + ".id}}\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
||||||
"({{ " + 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