mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03: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:
parent
0f4a4b6cb9
commit
94ff36b62f
@ -89,12 +89,22 @@ function AdminsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_admin = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_admin = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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,16 +119,26 @@ function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Res
|
||||
else {
|
||||
ReturnToCaller();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_credential = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_credential = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CredentialsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'CredentialList', 'GenerateList',
|
||||
|
||||
@ -120,12 +120,22 @@ function GroupsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_group = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_group = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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,16 +117,26 @@ function HostsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
else {
|
||||
ReturnToCaller(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_host = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_host = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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,16 +120,26 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
|
||||
else {
|
||||
ReturnToCaller();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_inventory = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_inventory = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InventoriesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'InventoryList', 'GenerateList',
|
||||
|
||||
@ -114,16 +114,26 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
||||
else {
|
||||
ReturnToCaller(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_credential = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_job_template = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function postJob(data) {
|
||||
// Once we have a credential and all required passwords, use this
|
||||
|
||||
@ -116,14 +116,24 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_project = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_project = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList',
|
||||
|
||||
@ -130,12 +130,22 @@ function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Ale
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_team = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_team = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,16 +115,26 @@ function UsersList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
else {
|
||||
ReturnToCaller();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggle_user = function(idx) {
|
||||
if (scope.selected.indexOf(idx) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(idx),1);
|
||||
scope.toggle_user = function(id) {
|
||||
if (scope.selected.indexOf(id) > -1) {
|
||||
scope.selected.splice(scope.selected.indexOf(id),1);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UsersList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'UserList', 'GenerateList',
|
||||
@ -135,7 +145,7 @@ function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope)
|
||||
{
|
||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||
//scope.
|
||||
//scope.
|
||||
|
||||
// Inject dynamic view
|
||||
var defaultUrl = '/api/v1/organizations/';
|
||||
|
||||
@ -14,7 +14,7 @@ angular.module('AdminListDefinition', [])
|
||||
iterator: 'admin',
|
||||
selectTitle: 'Add Administrators',
|
||||
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',
|
||||
|
||||
fields: {
|
||||
|
||||
@ -14,7 +14,7 @@ angular.module('GroupListDefinition', [])
|
||||
iterator: 'group',
|
||||
selectTitle: 'Add Group',
|
||||
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: {
|
||||
name: {
|
||||
|
||||
@ -13,7 +13,7 @@ angular.module('HostListDefinition', [])
|
||||
name: 'hosts',
|
||||
iterator: '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',
|
||||
|
||||
fields: {
|
||||
|
||||
@ -14,7 +14,7 @@ angular.module('InventoriesListDefinition', [])
|
||||
iterator: 'inventory',
|
||||
selectTitle: 'Add 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: {
|
||||
name: {
|
||||
|
||||
@ -14,7 +14,7 @@ angular.module('ProjectsListDefinition', [])
|
||||
iterator: 'project',
|
||||
selectTitle: 'Add Project',
|
||||
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: {
|
||||
name: {
|
||||
|
||||
@ -169,9 +169,9 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
||||
// table body
|
||||
html += "<tbody>\n";
|
||||
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 += (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 += "<td class=\"index-column\">{{ $index + (" + list.iterator + "Page * " + list.iterator + "PageSize) + 1 }}.</td>\n";
|
||||
var cnt = 2;
|
||||
@ -180,27 +180,28 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
||||
cnt++;
|
||||
if (! list.fields[fld].ngBind) {
|
||||
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 += "{{" + list.iterator + "." + fld + "}}";
|
||||
html += (list.fields[fld].key) ? "</a>" : "";
|
||||
html += (list.fields[fld].key && options.mode != 'lookup') ? "</a>" : "";
|
||||
html += "</td>\n";
|
||||
}
|
||||
else {
|
||||
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 += "{{ " + list.fields[fld].ngBind + " }}";
|
||||
html += (list.fields[fld].key) ? "</a>" : "";
|
||||
html += (list.fields[fld].key && options.mode != 'lookup') ? "</a>" : "";
|
||||
html += "</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (options.mode == 'select' ) {
|
||||
html += "<td><input type=\"checkbox\" name=\"select\" ng-click=\"toggle_" + list.iterator +
|
||||
"({{ " + list.iterator + ".id }})\" \></td>";
|
||||
html += "<td><input type=\"checkbox\" name=\"check_{{" + list.iterator + ".id}}\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
||||
//ng-click=\"toggle_" + list.iterator +
|
||||
// "({{ " + list.iterator + ".id }}, true)\"
|
||||
}
|
||||
else if (options.mode == 'edit') {
|
||||
// Row level actions
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user