summaryrefslogtreecommitdiffstats
path: root/install/ui/aci.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-02-03 21:42:50 -0600
committerAdam Young <ayoung@redhat.com>2011-02-07 11:31:17 -0500
commit348d734c59432a740b52924ac18ff47b30dad54e (patch)
tree7ed5d13f7a8f16dce89e6889366f9b661ef41cf1 /install/ui/aci.js
parenta6849ef2ba5611ac44b612b2c0552c685b22aa3a (diff)
downloadfreeipa-348d734c59432a740b52924ac18ff47b30dad54e.tar.gz
freeipa-348d734c59432a740b52924ac18ff47b30dad54e.tar.xz
freeipa-348d734c59432a740b52924ac18ff47b30dad54e.zip
Restructuring details page.
Previously the IPA.details_list_section can only be used with widgets that generates <dd> tag because it uses the following structure: <dl> <dt>Telephone Number:</dt> <span name="teleponenumber"> <dd>111-1111</dd> <dd>222-2222</dd> </span> </dl> The <dd> 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: <dl> <dt>Telephone Number:</dt> <dd> <span name="telephonenumber"> <div>111-1111</div> <div>222-2222</div> </span> </dd> </dl> This allows IPA.details_list_section to be used with any widgets without requiring the <dd> tag.
Diffstat (limited to 'install/ui/aci.js')
-rw-r--r--install/ui/aci.js74
1 files changed, 25 insertions, 49 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js
index 036731237..fbfb6ba3a 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -33,21 +33,16 @@ IPA.attributes_widget = function(spec) {
that.object_type = spec.object_type;
var id = spec.name;
- var dd_class = "other";
that.create = function(container) {
- var dd = $('<dd/>', {
- 'class': dd_class
- }).appendTo(container);
-
that.table = $('<table/>', {
id:id,
'class':'search-table aci-attribute-table'
}).
append('<thead/>').
append('<tbody/>').
- appendTo(dd);
+ appendTo(container);
var tr = $('<tr></tr>').appendTo($('thead', that.table));
tr.append($('<th/>', {
@@ -66,7 +61,7 @@ IPA.attributes_widget = function(spec) {
append('<th class="aci-attribute-column">Attribute</th>');
if (that.undo) {
- that.create_undo(dd);
+ that.create_undo(container);
}
if (that.object_type){
@@ -175,32 +170,16 @@ IPA.rights_widget = function(spec) {
that.rights = ['write', 'add', 'delete'];
- that.create = function(container){
-
- for (var i = 0; i<that.rights.length; i++) {
- $('<dd/>').
- append($('<input/>', {
- type: 'checkbox',
- name: that.name,
- value: that.rights[i],
- 'class': that.entity_name +'_'+ that.name
- })).
- append($('<label/>', {
- text: that.rights[i]
- })).
- appendTo(container);
- }
-
- if (that.undo) {
- var dd = $('<dd/>').appendTo(container);
- that.create_undo(dd);
+ that.init = function() {
+ for (var i=0; i<that.rights.length; i++) {
+ var right = that.rights[i];
+ that.add_option({label: right, value: right});
}
};
return that;
};
-
IPA.hidden_widget = function(spec) {
spec.label = '';
var that = IPA.widget(spec);
@@ -277,17 +256,15 @@ IPA.target_section = function(spec) {
})).
appendTo(dl);
- var span = $('<span/>', {
- name: 'filter'
- }).
- appendTo(dl);
-
var dd = $('<dd/>', {
'class': 'aci_by_filter first'
- }).
- appendTo(span);
+ }).appendTo(dl);
- that.filter_text.create(dd);
+ var span = $('<span/>', {
+ name: 'filter'
+ }).appendTo(dd);
+
+ that.filter_text.create(span);
}
@@ -333,15 +310,15 @@ IPA.target_section = function(spec) {
})).
appendTo(dl);
- var span = $('<span/>', {
- name: 'subtree'
- }).appendTo(dl);
-
var dd = $('<dd/>', {
'class': 'aci_by_query first'
- }).appendTo(span);
+ }).appendTo(dl);
- that.subtree_textarea.create(dd);
+ var span = $('<span/>', {
+ name: 'subtree'
+ }).appendTo(dd);
+
+ that.subtree_textarea.create(span);
}
function display_group_target(dl) {
@@ -356,16 +333,15 @@ IPA.target_section = function(spec) {
})).
appendTo(dl);
- var span = $('<span/>', {
- name: 'targetgroup'
- }).appendTo(dl);
-
var dd = $('<dd/>', {
'class': 'aci_by_group first'
- }).
- appendTo(span);
+ }).appendTo(dl);
+
+ var span = $('<span/>', {
+ name: 'targetgroup'
+ }).appendTo(dd);
- that.group_select.create(dd);
+ that.group_select.create(span);
}
that.create = function(container) {
@@ -680,7 +656,7 @@ IPA.entity_factories.delegation = function() {
entity:'group', join: true})).
custom_input(
IPA.rights_widget({name: 'permissions', label: 'Permissions',
- join: true})).
+ direction: 'horizontal', join: true})).
custom_input(
IPA.attributes_widget({
name:'attrs', object_type:'user', join: true})))).