From 613a3d0f5628a2e844c4f0e8629f0916e3a44794 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 31 Jan 2011 16:29:25 -0600 Subject: Added undo for permission rights. https://fedorahosted.org/freeipa/ticket/884 --- install/ui/aci.js | 101 ++++++++++++------------------------------------------ 1 file changed, 21 insertions(+), 80 deletions(-) (limited to 'install/ui/aci.js') diff --git a/install/ui/aci.js b/install/ui/aci.js index d0150c80..c3824425 100644 --- a/install/ui/aci.js +++ b/install/ui/aci.js @@ -328,89 +328,30 @@ IPA.entity_select_widget = function(spec){ IPA.rights_widget = function(spec){ var rights = ['write','add','delete']; - var that = IPA.widget({name:'permissions',label:'Permissions'}); + var that = IPA.checkboxes_widget(spec); that.id = spec.id; that.create = function(container){ - for (var i =0; i < rights.length; i += 1){ - $("
"). - append($('',{ - type:'checkbox', - 'class':that.entity_name +"_"+ that.name, - 'id':rights[i], - value:rights[i] - })). - append($('
'). + append($('', { + type: 'checkbox', + id: rights[i], + name: that.name, + value: rights[i], + 'class': that.entity_name +'_'+ that.name + })). + append($('
').appendTo(container); + that.create_undo(dd); } - return [retval]; }; return that; @@ -447,7 +388,7 @@ IPA.rights_section = function () { 'label': 'Rights' }; var that = IPA.details_section(spec); - that.add_field(IPA.rights_widget({name:'permissions'})); + that.add_field(IPA.rights_widget({name: 'permissions', label: 'Permissions', join: true})); return that; }; @@ -774,7 +715,7 @@ IPA.entity_factories.permission = function () { name: 'cn', undo: false })). - field(IPA.rights_widget({name:'permissions'})). + field(IPA.rights_widget({name: 'permissions', label: 'Permissions', join: true, undo: false})). section(IPA.target_section())). facet(IPA.search_facet(). column({name:'cn'})). @@ -896,8 +837,8 @@ IPA.entity_factories.delegation = function() { {name:'membergroup', label:"Member Group", entity:'group', join: true})). custom_input( - IPA.rights_widget({ - id:'delegation_rights'})). + IPA.rights_widget({name: 'permissions', label: 'Permissions', + id:'delegation_rights', join: true})). custom_input( IPA.attribute_table_widget({ name:'attrs', object_type:'user', join: true})))). -- cgit