From fc7c1cbb6a3e2cdec4d1f8b0860c040ac3204e90 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 14 Apr 2011 15:43:57 -0500 Subject: Entitlement download. A Download link has been added to download entitlement certificates. --- install/ui/entitle.js | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'install/ui/entitle.js') diff --git a/install/ui/entitle.js b/install/ui/entitle.js index 4c9cd13c6..17be45835 100644 --- a/install/ui/entitle.js +++ b/install/ui/entitle.js @@ -56,6 +56,11 @@ IPA.entity_factories.entitle = function() { { name: 'end', label: 'End' + }, + { + factory: IPA.entitle.certificate_column, + name: 'certificate', + label: 'Certificate' } ] }). @@ -404,6 +409,36 @@ IPA.entitle.search_facet = function(spec) { return that; }; +IPA.entitle.certificate_column = function(spec) { + + spec = spec || {}; + + var that = IPA.column(spec); + + that.setup = function(container, record) { + container.empty(); + + var certificate = record[that.name]; + + $('', { + 'href': '#download', + 'html': 'Download', + 'click': function() { + var dialog = IPA.cert.download_dialog({ + title: 'Download Certificate', + certificate: certificate, + add_pem_delimiters: false + }); + dialog.init(); + dialog.open(); + return false; + } + }).appendTo(container); + }; + + return that; +}; + IPA.entitle.certificate_dialog = function(spec) { spec = spec || {}; @@ -542,4 +577,4 @@ IPA.entitle.import_dialog = function(spec) { }); return that; -}; \ No newline at end of file +}; -- cgit