From 348d734c59432a740b52924ac18ff47b30dad54e Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 3 Feb 2011 21:42:50 -0600 Subject: Restructuring details page. Previously the IPA.details_list_section can only be used with widgets that generates
tag because it uses the following structure:
Telephone Number:
111-1111
222-2222
The
tag was previously used to handle multi-valued attributes. Since multi-valued attributes are now handled by the recently added IPA.multivalued_text_widget, the structure can be changed as follows:
Telephone Number:
111-1111
222-2222
This allows IPA.details_list_section to be used with any widgets without requiring the
tag. --- install/ui/details.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'install/ui/details.js') diff --git a/install/ui/details.js b/install/ui/details.js index 5872e81cf..7eb7c038e 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -333,19 +333,28 @@ IPA.details_section = function (spec){ return that; }; + that.text = function(spec) { + var field = IPA.text_widget(spec); + that.add_field(field); + return that; + }; + that.multivalued_text = function(spec) { var field = IPA.multivalued_text_widget(spec); that.add_field(field); return that; }; - that.create_field = function(spec) { + that.textarea = function(spec) { + var field = IPA.textarea_widget(spec); + that.add_field(field); + return that; + }; - //TODO: replace IPA.details_field with class-specific implementation - //Valid field classes: Str, IA5Str, Int, Bool and List - var field = IPA.details_field(spec); + that.radio = function(spec) { + var field = IPA.radio_widget(spec); that.add_field(field); - return field; + return that; }; that.create_text = function(spec) { @@ -526,7 +535,11 @@ IPA.details_list_section = function (spec){ title: label }).appendTo(dl); - var span = $('', { 'name': field.name }).appendTo(dl); + var dd = $('
', { + 'class': 'first' + }).appendTo(dl); + + var span = $('', { 'name': field.name }).appendTo(dd); field.create(span); } }; @@ -544,7 +557,7 @@ IPA.stanza = function (spec) { // This is to allow declarative style programming for details that.input = function(spec) { - that.create_field(spec); + that.text(spec); return that; }; -- cgit