summaryrefslogtreecommitdiffstats
path: root/install/ui/entity.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-04-11 20:22:38 -0500
committerEndi Sukma Dewata <edewata@people01.fedoraproject.org>2011-04-14 23:05:09 +0000
commite3ec1fb7efb12c3669855b6c388f196c268680ee (patch)
tree9a582745ccbb71444fe20aa668f461dbd47329f8 /install/ui/entity.js
parent805b94f22d42eddee42ed8772aca89036edb8399 (diff)
downloadfreeipa-e3ec1fb7efb12c3669855b6c388f196c268680ee.tar.gz
freeipa-e3ec1fb7efb12c3669855b6c388f196c268680ee.tar.xz
freeipa-e3ec1fb7efb12c3669855b6c388f196c268680ee.zip
Entitlement registration.
The entitlement facet will show buttons according to the entitlement status. If it's unregistered, the facet will show a Register button. If it's registered, the facet will show a Consume button.
Diffstat (limited to 'install/ui/entity.js')
-rw-r--r--install/ui/entity.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 4db58465d..23f792d1e 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -64,6 +64,9 @@ IPA.facet = function (spec) {
};
function init() {
+
+ that.entity = IPA.get_entity(that.entity_name);
+
for (var i=0; i<that.dialogs.length; i++){
var dialog = that.dialogs[i];
dialog.entity_name = that._entity_name;
@@ -220,7 +223,6 @@ IPA.entity = function (spec) {
that.standard_associations = that.create_association_facets;
-
that.init = function() {
if (!that.label) {
@@ -576,8 +578,14 @@ IPA.entity_builder = function(){
}
}
- that.entity = function(name){
- entity = IPA.entity({name: name});
+ that.entity = function(spec) {
+ if (spec instanceof Object){
+ var factory = spec.factory || IPA.entity;
+ entity = factory(spec);
+ } else {
+ var name = spec;
+ entity = IPA.entity({name: name});
+ }
return that;
};
@@ -588,7 +596,7 @@ IPA.entity_builder = function(){
} else {
dialog = IPA.dialog(spec);
}
- facet.dialog(dialog);
+ entity.dialog(dialog);
return that;
};