From 199d6815d49617b4b438a93ccf99e1e4e32a6221 Mon Sep 17 00:00:00 2001 From: Petr Voborník Date: Wed, 25 Jan 2012 13:06:15 +0100 Subject: Automember UI New UI for automember. Implemented: * search facet core * rule details facet * attribute_table_widget - new base class for tables which contains multivalued attribute with special add/remove commands * adding/removing conditions in details facet TODO: * label translations * UI for defining default rules https://fedorahosted.org/freeipa/ticket/2195 --- install/ui/widget.js | 351 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 350 insertions(+), 1 deletion(-) (limited to 'install/ui/widget.js') diff --git a/install/ui/widget.js b/install/ui/widget.js index 04c35bb6..807191e5 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -1678,6 +1678,355 @@ IPA.table_widget = function (spec) { return that; }; + +IPA.attribute_table_widget = function(spec) { + + + spec = spec || {}; + spec.columns = spec.columns || []; + + var that = IPA.table_widget(spec); + + that.attribute_name = spec.attribute_name || that.name; + that.adder_dialog_spec = spec.adder_dialog; + that.css_class = spec.css_class; + + that.add_command = spec.add_command; + that.remove_command = spec.remove_command; + + that.on_add = spec.on_add; + that.on_add_error = spec.on_add_error; + that.on_remove = spec.on_remove; + that.on_remove_error = spec.on_remove_error; + + that.create_column = function(spec) { + + if (typeof spec === 'string') { + spec = { + name: spec + }; + } + + spec.entity = that.entity; + + var factory = spec.factory || IPA.column; + + var column = factory(spec); + that.add_column(column); + return column; + }; + + that.create_columns = function() { + that.clear_columns(); + if (spec.columns) { + for (var i=0; i