From dde15772700da41ec931bb55087fbec6f30fab55 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Tue, 7 Sep 2010 10:08:19 -0400 Subject: associations -Refactored the associations code into a set of objects that are configured by the entities -Added support for associations that can be done in a single rpc -hostgroup to host and group to user associations working -Restructed sampledata so that the file is matched automatically by the RPC method name -The new ipa_cmd/sampledata scheme insists on there being sample data for any commands or the ipa_command fails. -Added sampledata files for all the calls we make -renamed several of the sampledata files to match their rpc calls -Started a pattern of refactoring where all the forms for the entity fall under a single object --- install/static/navigation.js | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'install/static/navigation.js') diff --git a/install/static/navigation.js b/install/static/navigation.js index ff21fdf5..94fe47a9 100644 --- a/install/static/navigation.js +++ b/install/static/navigation.js @@ -119,14 +119,14 @@ function buildNavigation(){ selectedSub.setup(facet); } }else if (currentMain && currentMain.setup){ - currentMain.setup(facet); + currentMain.setup(facet); } var whoami = $.cookie("whoami"); if (whoami == null){ - ipa_cmd( 'whoami', [], {}, whoamiSuccess, null,null, "sampledata/whoami.json"); + ipa_cmd( 'whoami', [], {}, whoamiSuccess, null,null); }else{ - setLoggedInText(whoami); + setLoggedInText(whoami); } } @@ -168,12 +168,41 @@ function setActiveTab(tabName){ $(activeTab).removeClass('main-nav-off').addClass("main-nav-on") } + +function buildFacetNavigation(facets){ + setupFacetNavigation(qs['tab'], qs['pkey'],qs['facet'], facets); +} + +function setupFacetNavigation(tab, pkey,facet,facets){ + $('#viewtype').css("display","block"); + $("#viewtype").html(""); + + for (var i =0; i < facets.length; i++){ + var li = $('
  • ').appendTo($("#viewtype")); + if (facets[i] == facet){ + $(''); + li.html(facets[i]); + }else{ + $('').appendTo(li); + $('',{ + href: "#tab="+tab+"&facet="+facets[i]+"&pkey="+pkey, + html: facets[i] + }).appendTo(li); + } + } +} + function clearOld(){ + + $('h1').html(""); + $('#viewtype').css("display","none"); + $('#search').css("display","none"); $('#details').css("display","none"); $('#content').css("display","none"); $('#associations').css("display","none"); + $('#searchResultsTable thead').html(""); $('#searchResultsTable tfoot').html(""); $('#searchResultsTable tbody').find("tr").remove(); @@ -194,11 +223,13 @@ function showSearch(){ function showContent(){ clearOld(); + $('#viewtype').css("display","block"); $('#content').css("display","block"); } function showDetails(){ clearOld(); + $('#viewtype').css("display","block"); $('#details').css("display","block"); } -- cgit