mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 03:45:01 -02:30
Added support for button labels and tool tips on related sets.
This commit is contained in:
@@ -162,7 +162,9 @@ angular.module('UserFormDefinition', [])
|
|||||||
actions: {
|
actions: {
|
||||||
add: {
|
add: {
|
||||||
ngClick: "add('credentials')",
|
ngClick: "add('credentials')",
|
||||||
icon: 'icon-plus'
|
icon: 'icon-plus',
|
||||||
|
label: 'Add',
|
||||||
|
awToolTip: 'Add a credential for this user'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -181,13 +183,15 @@ angular.module('UserFormDefinition', [])
|
|||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
ngClick: "edit('credentials', \{\{ credential.id \}\}, '\{\{ credential.name \}\}')",
|
ngClick: "edit('credentials', \{\{ credential.id \}\}, '\{\{ credential.name \}\}')",
|
||||||
icon: 'icon-edit',
|
icon: 'icon-edit',
|
||||||
class: 'btn-success'
|
class: 'btn-success',
|
||||||
|
awToolTip: 'Edit the credential'
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
ngClick: "delete('credentials', \{\{ credential.id \}\}, '\{\{ credential.name \}\}', 'credentials')",
|
ngClick: "delete('credentials', \{\{ credential.id \}\}, '\{\{ credential.name \}\}', 'credentials')",
|
||||||
icon: 'icon-remove',
|
icon: 'icon-remove',
|
||||||
class: 'btn-danger'
|
class: 'btn-danger',
|
||||||
|
awToolTip: 'Delete the credential'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -814,10 +814,15 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
|
|||||||
|
|
||||||
// Add actions(s)
|
// Add actions(s)
|
||||||
html += "<div class=\"list-actions\">\n";
|
html += "<div class=\"list-actions\">\n";
|
||||||
for (var action in form.related[itm].actions) {
|
for (var act in form.related[itm].actions) {
|
||||||
|
var action = form.related[itm].actions[act];
|
||||||
html += "<button class=\"btn btn-small btn-success\" ";
|
html += "<button class=\"btn btn-small btn-success\" ";
|
||||||
html += this.attr(form.related[itm]['actions'][action],'ngClick');
|
html += this.attr(action,'ngClick');
|
||||||
html += "><i class=\"" + form.related[itm]['actions'][action].icon + "\"></i></button>\n";
|
html += (action.awToolTip) ? this.attr(action,'awToolTip') : "";
|
||||||
|
html += (action.awToolTip) ? "data-placement=\"right\" " : "";
|
||||||
|
html += "><i class=\"" + action.icon + "\"></i>";
|
||||||
|
html += (action.label) ? " " + action.label : "";
|
||||||
|
html += "</button>\n";
|
||||||
}
|
}
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
|
|
||||||
@@ -866,13 +871,15 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
|
|||||||
|
|
||||||
// Row level actions
|
// Row level actions
|
||||||
html += "<td class=\"actions\">";
|
html += "<td class=\"actions\">";
|
||||||
for (action in form.related[itm].fieldActions) {
|
for (act in form.related[itm].fieldActions) {
|
||||||
|
var action = form.related[itm].fieldActions[act];
|
||||||
html += "<button class=\"btn btn-small";
|
html += "<button class=\"btn btn-small";
|
||||||
html += (form.related[itm]['fieldActions'][action].class) ?
|
html += (action.class) ? " " + action.class : "";
|
||||||
" " + form.related[itm]['fieldActions'][action].class : "";
|
html += "\" " + this.attr(action,'ngClick');
|
||||||
html += "\" " + this.attr(form.related[itm]['fieldActions'][action],'ngClick') +
|
html += (action.awToolTip) ? this.attr(action,'awToolTip') : "";
|
||||||
">" + this.icon(form.related[itm]['fieldActions'][action].icon);
|
html += (action.awToolTip) ? "data-placement=\"top\" " : "";
|
||||||
html += (form.related[itm].fieldActions[action].label) ? " " + form.related[itm].fieldActions[action].label : "";
|
html += ">" + this.icon(action.icon);
|
||||||
|
html += (action.label) ? " " + action.label : "";
|
||||||
html += "</button> ";
|
html += "</button> ";
|
||||||
}
|
}
|
||||||
html += "</td>";
|
html += "</td>";
|
||||||
|
|||||||
Reference in New Issue
Block a user