diff options
author | Adam Young <ayoung@redhat.com> | 2010-09-07 10:08:19 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-09-07 10:08:19 -0400 |
commit | dde15772700da41ec931bb55087fbec6f30fab55 (patch) | |
tree | 890bd7ecd8bb4d906c4b670b772b2a960c50f3c1 /install/static/navigation.js | |
parent | e93932b3235fc27b31a59c0cb77250acf15d3f31 (diff) | |
download | freeipa-dde15772700da41ec931bb55087fbec6f30fab55.tar.gz freeipa-dde15772700da41ec931bb55087fbec6f30fab55.tar.xz freeipa-dde15772700da41ec931bb55087fbec6f30fab55.zip |
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
Diffstat (limited to 'install/static/navigation.js')
-rw-r--r-- | install/static/navigation.js | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/install/static/navigation.js b/install/static/navigation.js index ff21fdf52..94fe47a94 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 = $('<li>').appendTo($("#viewtype")); + if (facets[i] == facet){ + $('<img src="but-selected.png" alt="" />'); + li.html(facets[i]); + }else{ + $('<img src="but-unselected.png" alt="" />').appendTo(li); + $('<a/>',{ + 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"); } |