summaryrefslogtreecommitdiffstats
path: root/install/ui/entity.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-04-18 10:59:50 -0500
committerEndi Sukma Dewata <edewata@people01.fedoraproject.org>2011-04-21 19:43:54 +0000
commit3528b4eca3cf2519a6af5a43f6b321cbd8eea138 (patch)
tree8e0ae420440e45429057dd4747a5aaa80eb0d47a /install/ui/entity.js
parentbc6f9accd9250114b4f0c457fa5badd7f794af8e (diff)
downloadfreeipa-3528b4eca3cf2519a6af5a43f6b321cbd8eea138.tar.gz
freeipa-3528b4eca3cf2519a6af5a43f6b321cbd8eea138.tar.xz
freeipa-3528b4eca3cf2519a6af5a43f6b321cbd8eea138.zip
Moved adder dialog box into entity.
The adder dialog box definition has been moved from search facet into entity to make it accessible from other facets.
Diffstat (limited to 'install/ui/entity.js')
-rw-r--r--install/ui/entity.js46
1 files changed, 7 insertions, 39 deletions
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 2cbed5b6b..39ce57350 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -601,6 +601,13 @@ IPA.entity_builder = function(){
return that;
};
+ that.adder_dialog = function(spec) {
+ spec.factory = spec.factory || IPA.add_dialog;
+ spec.name = spec.name || 'add';
+ spec.title = spec.title || IPA.messages.objects.user.add;
+ return that.dialog(spec);
+ };
+
that.details_facet = function (spec){
var sections = spec.sections;
spec.sections = null;
@@ -628,45 +635,6 @@ IPA.entity_builder = function(){
search_all: spec.search_all || false,
columns: spec.columns
});
-
- var current_dialog =
- IPA.add_dialog({
- 'name': 'add',
- 'title': IPA.messages.objects.user.add,
- entity_name: entity.name
- });
-
- facet.dialog(current_dialog);
-
- var add_fields = spec.add_fields;
- if (add_fields) {
- for (var i = 0; i < add_fields.length; i += 1){
- var field = add_fields[i];
- if (field instanceof Object){
- /* This is a bit of a hack ,and is here to support ACI
- permissions. The target section is a group of secveral
- widgets together. It makes more sense to do them as a
- seciont than as a widgit. However, since they can be mixed
- into the flow with the other widgets, the section needs to
- be definied here with the fields to get the order correct.*/
- var factory;
- if (field.section){
- factory = field.factory;
- field.factory = null;
- field.name = field.section;
- field.section = null;
- current_dialog.add_section(factory(field));
- }else{
- field.entity_name = entity.name;
- factory = field.factory || IPA.text_widget;
- current_dialog.field(factory(field));
- }
- }else{
- current_dialog.text(add_fields[i]);
- }
- }
- }
-
entity.facet(facet);
return that;
};