diff --git a/install/static/entity.js b/install/static/entity.js
index 5d59b3c72..9b62ce375 100644
--- a/install/static/entity.js
+++ b/install/static/entity.js
@@ -367,40 +367,89 @@ function ipa_entity_setup(container) {
facet.refresh();
}
+
+
+/*Returns the entity requested, as well as:
+ any nested tabs underneath it or
+ its parent tab and the others nested at the same level*/
+
+IPA.nested_tabs = function(entity_name){
+
+ var siblings = [];
+
+ for (var top_tab_index = 0;
+ top_tab_index < IPA.tab_set.length;
+ top_tab_index += 1){
+ var top_tab = IPA.tab_set[top_tab_index];
+ for (var subtab_index = 0;
+ subtab_index < top_tab.children.length;
+ subtab_index += 1){
+ if(top_tab.children[subtab_index].name){
+ if (top_tab.children[subtab_index].name === entity_name){
+ siblings.push(entity_name);
+ if (top_tab.children[subtab_index].children){
+ var nested_entities = top_tab.children[subtab_index].children;
+ for (var nested_index = 0;
+ nested_index < nested_entities.length;
+ nested_index += 1){
+ siblings.push (nested_entities[nested_index].name);
+ }
+ }
+ }else{
+ if (top_tab.children[subtab_index].children){
+ var nested_entities = top_tab.children[subtab_index].children;
+ for (var nested_index = 0;
+ nested_index < nested_entities.length;
+ nested_index += 1){
+ if (nested_entities[nested_index].name === entity_name){
+ siblings.push(top_tab.children[subtab_index].name);
+ for (var nested_index2 = 0;
+ nested_index2 < nested_entities.length;
+ nested_index2 += 1){
+ siblings.push(nested_entities[nested_index2].name);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return siblings;
+}
+
+
+
function ipa_facet_create_action_panel(container) {
var that = this;
var entity_name = that.entity_name;
-
var action_panel = $('
', {
"class": "action-panel",
html: $('
',{
text: IPA.metadata[entity_name].label
})
}).appendTo(container);
-
function build_link(other_facet,label){
var li = $('
', {
"class" : other_facet.display_class,
title: other_facet.name,
text: label,
click: function(entity_name, other_facet_name) {
- return function() {
- if($(this).hasClass('entity-facet-disabled')){
- return false;
- }
- var this_pkey = $('input[id=pkey]', action_panel).val();
- IPA.switch_and_show_page(
- entity_name, other_facet_name,
- this_pkey);
-
+ return function() {
+ if($(this).hasClass('entity-facet-disabled')){
return false;
- };
- }(entity_name, other_facet_name)
- });
+ }
+ var this_pkey = $('input[id=pkey]', action_panel).val();
+ IPA.switch_and_show_page(
+ entity_name, other_facet_name,
+ this_pkey);
+ return false;
+ };
+ }(entity_name, other_facet_name)
+ });
return li;
}
-
/*Note, for debugging purposes, it is useful to set var pkey_type = 'text';*/
var pkey_type = 'hidden';
$('', {
@@ -408,36 +457,62 @@ function ipa_facet_create_action_panel(container) {
id:'pkey',
name:'pkey'
}).appendTo(action_panel);
-
var ul = $('
', {'class': 'action'}).appendTo(action_panel);
-
var entity = IPA.get_entity(entity_name);
var facet_name = ipa_current_facet(entity);
-
var other_facet = entity.facets[0];
var other_facet_name = other_facet.name;
- var main_facet = build_link(other_facet,other_facet.label);
+ var nested_tabs = IPA.nested_tabs(entity_name);
+ var main_facet = build_link(other_facet,other_facet.label)
+ for (var nested_index = 0 ;
+ nested_index < nested_tabs.length;
+ nested_index += 1){
+ if (nested_tabs[nested_index] === entity_name){
+ /*assume for now that entities with only a single facet
+ do not have search*/
+ if (entity.facets.length > 0 ){
+ main_facet.text( 'List ' + IPA.metadata[entity_name].label);
+ }
+ main_facet.appendTo(ul);
- /*assumeing for now that entities with only a single facet
- do not have search*/
- if (entity.facets.length > 0 ){
- main_facet.text( 'List ' + IPA.metadata[entity_name].label);
+ ul.append($('
');
};
diff --git a/install/static/sudocmdgroup.js b/install/static/sudocmdgroup.js
index c8b7edf8d..22762aec0 100755
--- a/install/static/sudocmdgroup.js
+++ b/install/static/sudocmdgroup.js
@@ -103,28 +103,10 @@ function ipa_sudocmdgroup_search_facet(spec) {
that.create = function(container) {
- var action_panel = that.get_action_panel();
-
- var ul = $('ul', action_panel);
-
- /*Make sure that these go at the top of the action panel
- and in the same order as on the other SUDO entity pages */
- $('', {
- title: 'sudocmd',
- text: 'SUDO Command'
- }).prependTo(ul);
-
- $('', {
- title: 'sudorule',
- text: 'SUDO Rules'
- }).prependTo(ul);
-
-
that.search_facet_create(container);
- // TODO: replace with IPA.metadata[that.entity_name].label
container.children().last().prepend(
- $('', { 'html': 'SUDO Command Groups' }));
+ $('', { 'html': IPA.metadata.sudocmdgroup.label }));
container.children().last().prepend('