summaryrefslogtreecommitdiffstats
path: root/install/ui/facet.js
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-01-18 17:58:55 -0600
committerPetr Voborník <pvoborni@redhat.com>2012-01-23 15:38:35 +0100
commitfef343ae8f501aa67d4c746d9c7103d797fd6be2 (patch)
treef4cd5bad86ac0309dbcf3148dcdc10a8a62a0b17 /install/ui/facet.js
parent7c0c39581c567c2c5bd92f9396b6fd99a2b8a6f8 (diff)
downloadfreeipa.git-fef343ae8f501aa67d4c746d9c7103d797fd6be2.tar.gz
freeipa.git-fef343ae8f501aa67d4c746d9c7103d797fd6be2.tar.xz
freeipa.git-fef343ae8f501aa67d4c746d9c7103d797fd6be2.zip
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
Diffstat (limited to 'install/ui/facet.js')
-rw-r--r--install/ui/facet.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/install/ui/facet.js b/install/ui/facet.js
index d6502494..150c3e8f 100644
--- a/install/ui/facet.js
+++ b/install/ui/facet.js
@@ -413,6 +413,9 @@ IPA.table_facet = function(spec) {
that.search_all_attributes = spec.search_all_attributes;
that.selectable = spec.selectable === undefined ? true : spec.selectable;
+ that.row_enabled_attribute = spec.row_enabled_attribute;
+ that.row_disabled_attribute = spec.row_disabled_attribute;
+
that.columns = $.ordered_map();
var init = function() {
@@ -605,11 +608,31 @@ IPA.table_facet = function(spec) {
that.load_records = function(records) {
that.table.empty();
for (var i=0; i<records.length; i++) {
- that.table.add_record(records[i]);
+ that.add_record(records[i]);
}
that.table.set_values(that.selected_values);
};
+ that.add_record = function(record) {
+
+ var tr = that.table.add_record(record);
+
+ var attribute;
+ if (that.row_enabled_attribute) {
+ attribute = that.row_enabled_attribute;
+ } else if (that.row_disabled_attribute) {
+ attribute = that.row_disabled_attribute;
+ } else {
+ return;
+ }
+
+ var value = record[attribute];
+ var column = that.table.get_column(attribute);
+ if (column.format) value = column.format.parse(value);
+
+ that.table.set_row_enabled(tr, value);
+ };
+
that.get_records_command_name = function() {
return that.managed_entity.name+'_get_records';
};