summaryrefslogtreecommitdiffstats
path: root/install/ui/entity.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-04-14 15:43:57 -0500
committerAdam Young <ayoung@redhat.com>2011-04-18 11:12:02 -0400
commitfc7c1cbb6a3e2cdec4d1f8b0860c040ac3204e90 (patch)
tree7479196578958f1961a9d7ead4672965b87bf6d4 /install/ui/entity.js
parent8f9ddb058f922fbd33c4d15986eeb1f5be521cc5 (diff)
downloadfreeipa-fc7c1cbb6a3e2cdec4d1f8b0860c040ac3204e90.tar.gz
freeipa-fc7c1cbb6a3e2cdec4d1f8b0860c040ac3204e90.tar.xz
freeipa-fc7c1cbb6a3e2cdec4d1f8b0860c040ac3204e90.zip
Entitlement download.
A Download link has been added to download entitlement certificates.
Diffstat (limited to 'install/ui/entity.js')
-rw-r--r--install/ui/entity.js37
1 files changed, 19 insertions, 18 deletions
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 23f792d1e..2cbed5b6b 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -559,42 +559,43 @@ IPA.entity_builder = function(){
}
facet.add_section(current_section);
var fields = spec.fields;
- if (fields){
- var i;
- var field;
- for (i =0; i < fields.length; i += 1){
- field = fields[i];
- if (field instanceof Object){
- field.entity_name = entity.name;
- current_section.add_field(field.factory(field));
- }else{
+ if (fields) {
+ for (var i=0; i<fields.length; i++) {
+ var field_spec = fields[i];
+ var field;
+
+ if (field_spec instanceof Object) {
+ field_spec.entity_name = entity.name;
+ var factory = field_spec.factory || IPA.text_widget;
+ field = factory(field_spec);
+ } else {
field = IPA.text_widget({
- name:field,
- entity_name:entity.name
+ name: field_spec,
+ entity_name: entity.name
});
- current_section.add_field(field);
}
+ current_section.add_field(field);
}
}
}
that.entity = function(spec) {
- if (spec instanceof Object){
+ if (spec instanceof Object) {
var factory = spec.factory || IPA.entity;
entity = factory(spec);
} else {
- var name = spec;
- entity = IPA.entity({name: name});
+ entity = IPA.entity({ name: spec });
}
return that;
};
that.dialog = function(spec) {
var dialog;
- if (spec.factory) {
- dialog = spec.factory(spec);
+ if (spec instanceof Object){
+ var factory = spec.factory || IPA.dialog;
+ dialog = factory(spec);
} else {
- dialog = IPA.dialog(spec);
+ dialog = IPA.dialog({ name: spec });
}
entity.dialog(dialog);
return that;