Show disabled entries in gray.

The users, HBAC/sudo rules, HBAC test, and SELinux list pages have
been modified to show disabled entries in gray. Icons will be added
separately.

Ticket #1996
This commit is contained in:
Endi Sukma Dewata
2012-01-18 17:58:55 -06:00
committed by Petr Voborník
parent 7c0c39581c
commit fef343ae8f
14 changed files with 239 additions and 16 deletions

View File

@@ -947,6 +947,12 @@ IPA.format = function(spec) {
var that = {};
// parse attribute value into a normalized value
that.parse = function(value) {
return value;
};
// format normalized value
that.format = function(value) {
return value;
};
@@ -965,7 +971,8 @@ IPA.boolean_format = function(spec) {
that.show_false = spec.show_false;
that.invert_value = spec.invert_value;
that.format = function(value) {
// convert string boolean value into real boolean value, or keep the original value
that.parse = function(value) {
if (value === undefined || value === null) return '';
@@ -985,7 +992,15 @@ IPA.boolean_format = function(spec) {
if (typeof value === 'boolean') {
if (that.invert_value) value = !value;
}
return value;
};
// convert boolean value into formatted string, or keep the original value
that.format = function(value) {
if (typeof value === 'boolean') {
if (value) {
value = that.true_value;
@@ -1035,6 +1050,7 @@ IPA.column = function (spec) {
var value = record[that.name];
if (that.format) {
value = that.format.parse(value);
value = that.format.format(value);
}
value = value ? value.toString() : '';
@@ -1482,6 +1498,16 @@ IPA.table_widget = function (spec) {
that.setup_column(column, div, record);
}
return tr;
};
that.set_row_enabled = function(tr, enabled) {
if (enabled) {
tr.removeClass('disabled');
} else {
tr.addClass('disabled');
}
};
that.setup_column = function(column, div, record) {