From 8d597dcbb03ca70a342f470e0229c9934f75cb16 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 8 Feb 2011 15:41:24 -0600 Subject: Moved add dialog into search facet. Previously the add dialog is added into entity. The dialog is only used by the search facet, so it's now moved into the search facet. --- install/ui/netgroup.js | 51 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'install/ui/netgroup.js') diff --git a/install/ui/netgroup.js b/install/ui/netgroup.js index 052008439..d7908ef32 100644 --- a/install/ui/netgroup.js +++ b/install/ui/netgroup.js @@ -23,42 +23,41 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ IPA.entity_factories.netgroup = function() { + var that = IPA.entity({ 'name': 'netgroup' }); - that.init = function() { - var search_facet = IPA.search_facet({ - name: 'search', - label: 'Search', - entity_name: that.name - }); - search_facet.create_column({name:'cn'}); - search_facet.create_column({name:'description'}); - that.add_facet(search_facet); - - that.add_facet(function() { - var that = IPA.details_facet({name:'details'}); - that.add_section( - IPA.stanza({name:'identity', label:'Netgroup Settings'}). - input({name:'cn'}). - input({name: 'description'}). - input({name:'nisdomainname'})); - return that; - }()); + that.init = function() { - var dialog = IPA.add_dialog({ - name: 'add', - title: 'Add Netgroup' - }); - that.add_dialog(dialog); + that.facet( + IPA.search_facet({ + name: 'search', + label: 'Search', + entity_name: that.name + }). + column({name:'cn'}). + column({name:'description'}). + dialog( + IPA.add_dialog({ + name: 'add', + title: 'Add Netgroup' + }). + field(IPA.text_widget({ name: 'cn', undo: false})). + field(IPA.text_widget({ name: 'description', undo: false})))); - dialog.add_field(IPA.text_widget({ name: 'cn', undo: false})); - dialog.add_field(IPA.text_widget({ name: 'description', undo: false})); + that.facet( + IPA.details_facet({name: 'details'}). + section( + IPA.stanza({name: 'identity', label: 'Netgroup Settings'}). + input({name: 'cn'}). + input({name: 'description'}). + input({name: 'nisdomainname'}))); that.create_association_facets(); that.entity_init(); }; + return that; }; -- cgit