summaryrefslogtreecommitdiffstats
path: root/install/ui/navigation.js
diff options
context:
space:
mode:
authorPetr Voborník <pvoborni@redhat.com>2012-01-27 17:20:25 +0100
committerEndi S. Dewata <edewata@redhat.com>2012-02-01 12:47:42 -0600
commitc00267308e2844b2a345c22df5c045117fcff9a2 (patch)
tree6b3c5f864b23e5cd8750c8545f167012a8c53ecb /install/ui/navigation.js
parentb73fc6e550fed9a1b6d83a03fa16f43b361ec8aa (diff)
downloadfreeipa.git-c00267308e2844b2a345c22df5c045117fcff9a2.tar.gz
freeipa.git-c00267308e2844b2a345c22df5c045117fcff9a2.tar.xz
freeipa.git-c00267308e2844b2a345c22df5c045117fcff9a2.zip
Navigation and redirection to various facets
In current implementation target facet of navigation(from menu) and redirection is always one exact facet per entity. There isn't a way to navigate to different facet from menu or redirect to different facets from various facets. This patch adds: * possibility to define menu items which can navigate to different facets of various entities. This also means that now current menu tree can contain leafs with the same entity. * possibility to define redirection target per facet - it is needed to keep breadcrumb navigation consistent with various navigation tree patch leading to same entity leafs. This functionality is needed for Automember UI. Automember UI is designed as if it was for two entities but it is in fact only one. https://fedorahosted.org/freeipa/ticket/2195
Diffstat (limited to 'install/ui/navigation.js')
-rw-r--r--install/ui/navigation.js44
1 files changed, 40 insertions, 4 deletions
diff --git a/install/ui/navigation.js b/install/ui/navigation.js
index 84df7f4d..72c91426 100644
--- a/install/ui/navigation.js
+++ b/install/ui/navigation.js
@@ -191,7 +191,7 @@ IPA.navigation = function(spec) {
// push entity path and facet state
state = {};
- $.extend(state, that.get_path_state(tab.entity.name));
+ $.extend(state, that.get_path_state(tab.name));
$.extend(state, facet.state);
$.bbq.pushState(state, 2);
@@ -206,6 +206,26 @@ IPA.navigation = function(spec) {
$.bbq.removeState(key);
};
+ that.show_tab = function(tab_name, pkey) {
+
+ var tab = that.get_tab(tab_name);
+
+ var state = that.get_path_state(tab.name);
+
+ if (tab.entity) {
+
+ if (tab.facet) {
+ state[tab.entity.name + '-facet'] = tab.facet;
+ }
+
+ if (pkey) {
+ state[tab.entity.name + '-pkey'] = pkey;
+ }
+ }
+
+ return that.push_state(state);
+ };
+
that.show_page = function(entity_name, facet_name, pkey) {
var state = that.get_path_state(entity_name);
@@ -243,6 +263,22 @@ IPA.navigation = function(spec) {
return that.push_state(state);
};
+ that.get_tab_facet = function(tab_name) {
+
+ var facet = null;
+ var tab = that.get_tab(tab_name);
+
+ if (tab.entity) {
+ if (tab.facet) {
+ facet = tab.entity.get_facet(tab.facet);
+ } else {
+ facet = tab.entity.get_facet(tab.entity.redirect_facet);
+ }
+ }
+
+ return facet;
+ };
+
that.create = function() {
@@ -279,7 +315,7 @@ IPA.navigation = function(spec) {
}
// selection is triggered by mouse click, update the URL state
- return that.show_page(name);
+ return that.show_tab(name);
}
});
};
@@ -389,8 +425,8 @@ IPA.navigation = function(spec) {
that.content);
if (!entity_container.length) {
tab.content = $('<div/>', {
- name: tab.name,
- title: tab.label,
+ name: tab.entity.name,
+ title: tab.entity.label,
'class': 'entity'
}).appendTo(that.content);
tab.entity.create(tab.content);