From fef343ae8f501aa67d4c746d9c7103d797fd6be2 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 18 Jan 2012 17:58:55 -0600 Subject: 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 --- install/ui/widget.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'install/ui/widget.js') diff --git a/install/ui/widget.js b/install/ui/widget.js index 4972372c..85d9282c 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -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) { -- cgit