diff --git a/install/ui/add.js b/install/ui/add.js
index 33df62abc..cde6d335b 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -83,7 +83,7 @@ IPA.add_dialog = function (spec) {
pkey = pkey[0];
}
- IPA.nav.show_page(that.entity_name, 'details', pkey);
+ IPA.nav.show_page(that.entity_name, 'default', pkey);
}
);
});
diff --git a/install/ui/association.js b/install/ui/association.js
index 2115e0fe1..8030631b4 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -277,25 +277,6 @@ IPA.association_config = function (spec) {
return that;
};
-
-IPA.association_pkey_setup = function (container, record) {
- var other_entity = this.entity_name;
- container.empty();
- var value = record[this.name];
- value = value ? value.toString() : '';
- $('', {
- 'href': '#'+value,
- 'html': value,
- 'click': function (value) {
- return function() {
- IPA.nav.show_page(other_entity, 'default', value);
- return false;
- };
- }(value)
- }).appendTo(container);
-};
-
-
IPA.association_table_widget = function (spec) {
spec = spec || {};
@@ -325,14 +306,6 @@ IPA.association_table_widget = function (spec) {
return column;
};
- that.super_create_column = that.create_column;
-
- that.create_column = function(spec){
- if (spec.link_entity){
- spec.setup = IPA.association_pkey_setup;
- }
- return that.super_create_column(spec);
- };
/*this is duplicated in the facet... should be unified*/
var i;
if (spec.columns){
@@ -363,6 +336,13 @@ IPA.association_table_widget = function (spec) {
for (var i=0; i', {
- 'href': '#'+value,
- 'html': value,
- 'click': function (value) {
- return function() {
- IPA.nav.show_page(that.other_entity, 'default', value);
- return false;
- };
- }(value)
- }).appendTo(container);
- };
}
+ that.table.set_columns(columns);
+
for (i=0; i', {
- 'href': '#'+value,
- 'html': value,
- 'click': function (value) {
- return function() {
- IPA.nav.show_page(that.other_entity, 'details', value);
- return false;
- };
- }(value)
- }).appendTo(container);
- };
-
that.create_column({
name: 'description',
width: '350px'
diff --git a/install/ui/host.js b/install/ui/host.js
index cece90d11..fe35e0f1f 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -365,34 +365,16 @@ IPA.host_managedby_host_facet = function (spec) {
var column = that.create_column({
name: 'fqdn',
- primary_key: true
+ primary_key: true,
+ link: true
});
- column.setup = function(container, record) {
- container.empty();
-
- var value = record[column.name];
- value = value ? value.toString() : '';
-
- $('', {
- 'href': '#'+value,
- 'html': value,
- 'click': function (value) {
- return function() {
- IPA.nav.show_page(that.other_entity, 'details', value);
- return false;
- };
- }(value)
- }).appendTo(container);
- };
-
that.create_adder_column({
name: 'fqdn',
primary_key: true,
width: '200px'
});
-
that.association_facet_init();
};
diff --git a/install/ui/navigation.js b/install/ui/navigation.js
index 875f4056c..8e332cf67 100644
--- a/install/ui/navigation.js
+++ b/install/ui/navigation.js
@@ -27,6 +27,8 @@ IPA.navigation = function(spec) {
var that = {};
+ that.name = spec.name;
+
that.container = spec.container;
that.content = spec.content;
that.tab_class = spec.tab_class || 'tabs';
diff --git a/install/ui/search.js b/install/ui/search.js
index 5a9b14f05..9d6e51369 100644
--- a/install/ui/search.js
+++ b/install/ui/search.js
@@ -51,26 +51,6 @@ IPA.search_facet = function(spec) {
that.init_table = function(entity){
- function setup_column(column,entity) {
- column.setup = function(container, record) {
- container.empty();
-
- var value = record[column.name];
- value = value ? value.toString() : '';
-
- $('', {
- 'href': '#'+value,
- 'html': value,
- 'click': function (value) {
- return function() {
- IPA.nav.show_page(entity.name, 'default', value);
- return false;
- };
- }(value)
- }).appendTo(container);
- };
- }
-
that.table = IPA.table_widget({
id: entity.name+'-search',
'class': 'content-table',
@@ -88,9 +68,13 @@ IPA.search_facet = function(spec) {
var param_info = IPA.get_entity_param(entity.name, column.name);
column.primary_key = param_info && param_info['primary_key'];
+ column.link = column.primary_key;
- if (column.primary_key) {
- setup_column(column,entity);
+ if (column.link) {
+ column.link_handler = function(value) {
+ IPA.nav.show_page(entity.name, 'default', value);
+ return false;
+ };
}
that.table.add_column(column);
diff --git a/install/ui/service.js b/install/ui/service.js
index 9b9b1d59b..7af80c7ee 100644
--- a/install/ui/service.js
+++ b/install/ui/service.js
@@ -355,28 +355,10 @@ IPA.service_managedby_host_facet = function(spec) {
var column = that.create_column({
name: 'fqdn',
- primary_key: true
+ primary_key: true,
+ link: true
});
- column.setup = function(container, record) {
- container.empty();
-
- var value = record[column.name];
- value = value ? value.toString() : '';
-
- $('', {
- 'href': '#'+value,
- 'html': value,
- 'click': function (value) {
- return function() {
- IPA.nav.show_page(that.other_entity, 'details', value);
- return false;
- };
- }(value)
- }).appendTo(container);
- };
-
-
that.create_adder_column({
name: 'fqdn',
primary_key: true,
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 9624ae824..b3882b05f 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -66,7 +66,7 @@ IPA.entity_factories.sudocmd = function () {
name: 'cn',
primary_key: true,
width: '150px',
- link_entity: true
+ link: true
},
{
name: 'description',
@@ -120,7 +120,7 @@ IPA.entity_factories.sudocmdgroup = function () {
name: 'sudocmd',
primary_key: true,
width: '150px',
- link_entity: true
+ link: true
},
{
name: 'description',
diff --git a/install/ui/user.js b/install/ui/user.js
index 63c2ec4c8..8a8f9443d 100644
--- a/install/ui/user.js
+++ b/install/ui/user.js
@@ -26,6 +26,11 @@
IPA.entity_factories.user = function() {
+ var link = true;
+ if (IPA.nav && IPA.nav.name == 'self-service') {
+ link = false;
+ }
+
var builder = IPA.entity_builder();
builder.
@@ -90,17 +95,22 @@ IPA.entity_factories.user = function() {
}]}).
association_facet({
name: 'memberof_group',
- associator: IPA.serial_associator
+ associator: IPA.serial_associator,
+ link: link
}).
association_facet({
name: 'memberof_netgroup',
- associator: IPA.serial_associator
+ associator: IPA.serial_associator,
+ link: link
}).
association_facet({
name: 'memberof_role',
- associator: IPA.serial_associator
+ associator: IPA.serial_associator,
+ link: link
+ }).
+ standard_association_facets({
+ link: link
}).
- standard_association_facets().
adder_dialog({
fields: ['uid', 'givenname', 'sn']
});
@@ -108,9 +118,6 @@ IPA.entity_factories.user = function() {
return builder.build();
};
-/* ATTRIBUTE CALLBACKS */
-
-
IPA.user_status_widget = function(spec) {
spec = spec || {};
diff --git a/install/ui/webui.js b/install/ui/webui.js
index 94c20d4a9..c014cea72 100644
--- a/install/ui/webui.js
+++ b/install/ui/webui.js
@@ -30,6 +30,8 @@ IPA.admin_navigation = function(spec) {
spec = spec || {};
+ spec.name = 'admin';
+
spec.tabs = [
{name: 'identity', label: IPA.messages.tabs.identity, children: [
{entity: 'user'},
@@ -79,10 +81,11 @@ IPA.self_serv_navigation = function(spec) {
spec = spec || {};
+ spec.name = 'self-service';
+
spec.tabs = [
{name: 'identity', label: IPA.messages.tabs.identity, children: [
- {entity: 'user'},
- {entity: 'group'}
+ {entity: 'user'}
]}];
var that = IPA.navigation(spec);
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 1af9fd839..3e31b4c4a 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1014,39 +1014,53 @@ IPA.column = function (spec) {
that.name = spec.name;
that.label = spec.label;
- that.primary_key = spec.primary_key;
that.width = spec.width;
- that.entity_name = spec.entity_name;
- that.format = spec.format;
- that.setup = spec.setup || setup;
+ that.entity_name = spec.entity_name;
+ that.primary_key = spec.primary_key;
+ that.link = spec.link;
+
+ that.format = spec.format;
that.init = function() {
if (that.entity_name && !that.label) {
var param_info = IPA.get_entity_param(that.entity_name, that.name);
if (param_info) {
that.label = param_info.label;
- }else{
+ } else {
alert('cannot find label for ' + that.entity_name + ' ' +
that.name);
}
}
};
- function setup(container, record) {
-
+ that.setup = function(container, record) {
container.empty();
var value = record[that.name];
- if (that.format && value){
+ if (that.format && value) {
value = that.format(value);
}
-
value = value ? value.toString() : '';
+ if (that.link) {
+ $('', {
+ href: '#'+value,
+ html: value,
+ click: function() {
+ return that.link_handler(value);
+ }
+ }).appendTo(container);
- container.append(value);
- }
+ } else {
+ container.append(value);
+ }
+
+ };
+
+ that.link_handler = function(value) {
+ return false;
+ };
return that;
};