From 26ded75be94e60a34a19d06ce4a5fb3185875cd5 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 10 Aug 2011 20:03:02 -0500 Subject: Fixed layout problem in permission adder dialog. In order to maintain consistent layout between details page and dialog boxes the IPA.details_list_section has been replaced with IPA.details_table_section which is based on table. The IPA.target_section and other subclasses of IPA.details_list_section have been converted to use IPA.details_table_section as well. The unit tests have been updated accordingly. Ticket #1648 --- install/ui/details.js | 83 ++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 44 deletions(-) (limited to 'install/ui/details.js') diff --git a/install/ui/details.js b/install/ui/details.js index dbdca5a1..23f217af 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -95,7 +95,8 @@ IPA.details_section = function(spec) { var field = fields[i]; var field_container = $('
', { name: field.name, - 'class': 'details-field' + title: field.label, + 'class': 'field' }).appendTo(container); field.create(field_container); } @@ -167,36 +168,7 @@ IPA.details_section = function(spec) { return that; }; - -/** - * This class creates a details section formatted as a list of - * attributes names and values. The list is defined using a
tag. - * The attribute name is defined inside a
tag. The attribute - * value is specified within a inside a
tag. If the - * attribute has multiple values the will contain be - * duplicated to display each value. - * - * Example: - *
- * - *
First Name:
- *
- * - * John Smith - * - *
- * - *
Telephone Number:
- *
- * - *
111-1111
- *
222-2222
- *
- *
- * - *
- */ -IPA.details_list_section = function(spec) { +IPA.details_table_section = function(spec) { spec = spec || {}; @@ -207,33 +179,56 @@ IPA.details_list_section = function(spec) { // do not call section_create() here - var dl = $('
', { - 'id': that.name, - 'class': 'entryattrs' - }).appendTo(container); + var table = $('', { + 'class': 'section-table' + }).appendTo(that.container); var fields = that.fields.values; for (var i=0; i').appendTo(table); - $('
', { - html: label+':', - title: label - }).appendTo(dl); + var td = $('
', { + 'class': 'section-cell-label' + }).appendTo(tr); - var dd = $('
').appendTo(dl); + $('
', { + 'class': 'section-cell-field' + }).appendTo(tr); var field_container = $('
', { name: field.name, - 'class': 'details-field' - }).appendTo(dd); + title: field.label, + 'class': 'field' + }).appendTo(td); + field.create(field_container); + + if (field.optional){ + field_container.css('display', 'none'); + var link = $('', { + text: IPA.messages.widget.optional, + href: '', + click: function() { + field_container.css('display', 'inline'); + link.css('display', 'none'); + return false; + } + }).appendTo(td); + } } }; - that.list_section_create = that.create; + that.table_section_create = that.create; return that; }; -- cgit