From aa7ecb6f5ff234fa9001bbea3ebe2e5360656139 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 1 Oct 2010 12:53:13 -0500 Subject: Autogenerating Quick Links. ipa_entity_quick_links() has been added to generate quick links automatically from object's attribute_members, the same logic used for generating facet list. The search definition for each entity has been updated to use the new function. A unit test has been added for this function. --- install/static/user.js | 59 +------------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) (limited to 'install/static/user.js') diff --git a/install/static/user.js b/install/static/user.js index 5ac7f0ae..2698c8b0 100644 --- a/install/static/user.js +++ b/install/static/user.js @@ -27,7 +27,7 @@ ipa_entity_set_search_definition('user', [ ['mail', 'EMAIL', null], ['telephonenumber', 'Phone', null], ['title', 'Job Title', null], - ['quick_links', 'Quick Links', user_render_quick_links] + ['quick_links', 'Quick Links', ipa_entity_quick_links] ]); ipa_entity_set_add_definition('user', [ @@ -208,60 +208,3 @@ function a_numbers(jobj, result, mode) function a_manager(jobj, result, mode) { } - -function user_render_quick_links(tr, attr, value, entry_attrs) { - - var td = $(""); - tr.append(td); - - $("", { - href: "jslink", - html: $(""), - click: function() { - var state = {}; - state['user-facet'] = 'details'; - state['user-pkey'] = entry_attrs['uid'][0]; - $.bbq.pushState(state); - return false; - } - }).appendTo(td); - - $("", { - href: "jslink", - html: $(""), - click: function() { - var state = {}; - state['user-facet'] = 'associate'; - state['user-enroll'] = 'group'; - state['user-pkey'] = entry_attrs['uid'][0]; - $.bbq.pushState(state); - return false; - } - }).appendTo(td); - - $("", { - href: "jslink", - html: $(""), - click: function() { - var state = {}; - state['user-facet'] = 'associate'; - state['user-enroll'] = 'netgroup'; - state['user-pkey'] = entry_attrs['uid'][0]; - $.bbq.pushState(state); - return false; - } - }).appendTo(td); - - $("", { - href: "jslink", - html: $(""), - click: function() { - var state = {}; - state['user-facet'] = 'associate'; - state['user-enroll'] = 'role'; - state['user-pkey'] = entry_attrs['uid'][0]; - $.bbq.pushState(state); - return false; - } - }).appendTo(td); -} -- cgit