From ec59e618da26b3514c9e174b7a7e8aa3e0deb462 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Tue, 1 Feb 2011 13:06:58 -0500 Subject: use entity select widget for permissions https://fedorahosted.org/freeipa/ticket/879 --- install/ui/aci.js | 154 ++---------------------------------------------------- 1 file changed, 5 insertions(+), 149 deletions(-) (limited to 'install/ui/aci.js') diff --git a/install/ui/aci.js b/install/ui/aci.js index caa1435c..67c2d5f8 100644 --- a/install/ui/aci.js +++ b/install/ui/aci.js @@ -165,56 +165,7 @@ IPA.attribute_table_widget = function(spec) { return that; }; -IPA.targetgroup_widget = function(spec) { - spec = spec || {}; - - var that = IPA.select_widget(spec); - - that.filter = spec.filter || ''; - - that.create = function(container) { - that.select = $('', { - id: that.name + '-entity-select', - change: function(){ - - } - }).appendTo(dd); - - - that.entity_filter = $('',{ - size:10, - type: 'text', - id: 'entity_filter', - style: 'display: none;', - keypress: function(){ - populate_select(); - } - }).appendTo(dd); - - $('',{ - href:"", - text: 'add ' +entity + ' filter: ', - click:function(){ - that.entity_filter.css('display','inline'); - $(this).css('display','none'); - return false; - } - }).appendTo(dd); - populate_select(); - }; - that.reset = function(){ - that.entity_filter.val(that.values[0]); - populate_select(that.values[0]); - - }; - - that.is_dirty = function(){ - return (that.save()[0] !== that.values[0]); - }; - - that.load = function(record){ - var value = record[that.name]; - if (value instanceof Array) { - that.values = value; - } else { - that.values = value ? [value] : ['']; - } - that.reset(); - }; - - that.save = function(){ - return [$('option:selected', that.entity_select).val()]; - }; - return that; -}; IPA.rights_widget = function(spec){ var rights = ['write','add','delete']; @@ -528,6 +390,8 @@ IPA.target_section = function () { } function display_group_target(dl){ + + $('
' ). append($('', { type: 'radio', @@ -539,24 +403,16 @@ IPA.target_section = function () { })). appendTo(dl); - that.group_filter = $('',{ - type: 'text', - id: 'group_filter' }); var span = $('', { name: 'targetgroup' }).appendTo(dl); - $('
', { + var dd = $('
', { 'class': 'aci_by_group first' }). - append(that.group_filter). - append($('')). appendTo(span); - var dd = $('
', { - 'class': 'aci_by_group other' - }).appendTo(span); that.group_select.create(dd); } @@ -619,7 +475,6 @@ IPA.target_section = function () { that.load = function(record) { set_aci_type(record); - that.group_select.filter = that.group_filter.val(); that.attribute_table.object_type = record.type; that.section_load(record); @@ -637,7 +492,8 @@ IPA.target_section = function () { that.add_field(IPA.text_widget({name: 'filter'})); that.add_field(IPA.textarea_widget({name: 'subtree'})); - that.group_select = IPA.targetgroup_widget({name: 'targetgroup'}); + that.group_select = IPA.entity_select_widget( + {name: 'targetgroup', entity:'group'}); that.add_field(that.group_select); that.type_select = IPA.type_widget({name: 'type'}); -- cgit