From 7a25523d63559b19babd83c74223d2d0c4d75157 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Thu, 30 Jun 2011 17:38:59 -0400 Subject: entity link for password policy https://fedorahosted.org/freeipa/ticket/1111 reset() now hides both the link and the label calucalating should_link is now a function that can be overloaded. --- install/ui/widget.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'install/ui/widget.js') diff --git a/install/ui/widget.js b/install/ui/widget.js index a56e5525..2ea345d9 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -1729,3 +1729,59 @@ IPA.entity_select_widget = function(spec) { return that; }; + +IPA.entity_link_widget = function(spec) { + var that = IPA.widget(spec); + var no_link_value = spec.no_link_value || null; + var should_link = true; + var other_pkey = null; + var other_entity = spec.entity; + + that.super_create = that.create; + that.create = function(container) { + that.super_create(container); + that.link = + $('', { + href: 'jslink', + title: '', + html: '', + click: function() { + if (should_link){ + IPA.nav.show_page(other_entity, 'default', other_pkey); + } + return false; + } + }).appendTo(container); + + that.label = $('