From 2fd311ad489e8c301d3069ad3c01d80f279369c3 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Tue, 14 Sep 2010 22:26:15 -0400 Subject: Adding quick links in user and group search results. The render_call() signature has been modified to pass the entry_attrs so each callback function can construct the appropriate quick links using any attributes from the search results. The callback function has been implemented for user and group entities. --- install/static/user.js | 58 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) (limited to 'install/static/user.js') diff --git a/install/static/user.js b/install/static/user.js index a8954be1..11880c84 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], - ['actions', 'Actions', null] + ['quick_links', 'Quick Links', user_render_quick_links] ]); ipa_entity_set_add_definition('user', [ @@ -209,3 +209,59 @@ function a_manager(jobj, result, mode) { } +function user_render_quick_links(tr, attr, value, entry_attrs) { + + var td = $(""); + tr.append(td); + + $("", { + href: "jslink", + html: "[D]", + 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: "[G]", + 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: "[N]", + 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: "[R]", + 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