summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--install/static/entity.js24
-rw-r--r--install/static/group.js2
-rwxr-xr-xinstall/static/hbacsvcgroup.js2
-rw-r--r--install/static/host.js2
-rw-r--r--install/static/service.js2
-rwxr-xr-xinstall/static/sudocmdgroup.js2
-rw-r--r--install/static/test/data/ipa_init.json5
-rw-r--r--ipalib/plugins/internal.py4
8 files changed, 34 insertions, 9 deletions
diff --git a/install/static/entity.js b/install/static/entity.js
index 6e2b501b..548623e2 100644
--- a/install/static/entity.js
+++ b/install/static/entity.js
@@ -151,9 +151,7 @@ function ipa_entity(spec) {
return config;
};
- that.create_association_facet = function(other_entity, attribute_member) {
-
- var label = IPA.metadata[other_entity].label;
+ that.create_association_facet = function(attribute_member, other_entity, label) {
if (!attribute_member) {
attribute_member = ipa_get_member_attribute(
@@ -173,12 +171,30 @@ function ipa_entity(spec) {
var attribute_members = IPA.metadata[that.name].attribute_members;
for (var attribute_member in attribute_members) {
+
+ // skip non-assignable associations
+ if (attribute_member === 'memberindirect') continue;
+ if (attribute_member === 'enrolledby') continue;
+
var other_entities = attribute_members[attribute_member];
for (var j = 0; j < other_entities.length; j++) {
var other_entity = other_entities[j];
+ var other_entity_name = IPA.metadata[other_entity].label;
+
+ var label = other_entity_name;
+
+ if (attribute_member.match(/^memberof$/)) {
+ label = IPA.messages.association.membershipin+' '+other_entity_name;
+
+ } else if (attribute_member.match(/^member/)) {
+ label = other_entity_name+' '+IPA.messages.association.members;
+
+ } else if (attribute_member.match(/^managedby$/)) {
+ label = IPA.messages.association.managedby+' '+other_entity_name;
+ }
- var facet = that.create_association_facet(other_entity, attribute_member);
+ var facet = that.create_association_facet(attribute_member, other_entity, label);
if (that.get_facet(facet.name)) continue;
that.add_facet(facet);
}
diff --git a/install/static/group.js b/install/static/group.js
index bcac4098..b4446343 100644
--- a/install/static/group.js
+++ b/install/static/group.js
@@ -64,7 +64,7 @@ function ipa_group() {
facet = ipa_group_member_user_facet({
'name': 'member_user',
- 'label': 'Users',
+ 'label': IPA.metadata['user'].label+' '+IPA.messages.association.members,
'other_entity': 'user'
});
that.add_facet(facet);
diff --git a/install/static/hbacsvcgroup.js b/install/static/hbacsvcgroup.js
index 9cc1cdea..94a79c02 100755
--- a/install/static/hbacsvcgroup.js
+++ b/install/static/hbacsvcgroup.js
@@ -55,7 +55,7 @@ function ipa_hbacsvcgroup() {
facet = ipa_hbacsvcgroup_member_hbacsvc_facet({
'name': 'member_hbacsvc',
- 'label': 'Services',
+ 'label': IPA.metadata['hbacsvc'].label+' '+IPA.messages.association.members,
'other_entity': 'hbacsvc'
});
that.add_facet(facet);
diff --git a/install/static/host.js b/install/static/host.js
index 4f3a636e..484b6477 100644
--- a/install/static/host.js
+++ b/install/static/host.js
@@ -60,7 +60,7 @@ function ipa_host() {
facet = ipa_host_managedby_host_facet({
'name': 'managedby_host',
- 'label': 'Managed by Hosts',
+ 'label': IPA.messages.association.managedby+' '+IPA.metadata['host'].label,
'other_entity': 'host'
});
that.add_facet(facet);
diff --git a/install/static/service.js b/install/static/service.js
index 67073746..5d9e21ad 100644
--- a/install/static/service.js
+++ b/install/static/service.js
@@ -55,7 +55,7 @@ function ipa_service() {
facet = ipa_service_managedby_host_facet({
'name': 'managedby_host',
- 'label': 'Hosts',
+ 'label': IPA.messages.association.managedby+' '+IPA.metadata['host'].label,
'other_entity': 'host'
});
that.add_facet(facet);
diff --git a/install/static/sudocmdgroup.js b/install/static/sudocmdgroup.js
index 09b2a741..2d2b3298 100755
--- a/install/static/sudocmdgroup.js
+++ b/install/static/sudocmdgroup.js
@@ -55,7 +55,7 @@ function ipa_sudocmdgroup() {
facet = ipa_sudocmdgroup_member_sudocmd_facet({
'name': 'member_sudocmd',
- 'label': 'Commands',
+ 'label': IPA.metadata['sudocmd'].label+' '+IPA.messages.association.members,
'other_entity': 'sudocmd'
});
that.add_facet(facet);
diff --git a/install/static/test/data/ipa_init.json b/install/static/test/data/ipa_init.json
index b868df88..26c7e730 100644
--- a/install/static/test/data/ipa_init.json
+++ b/install/static/test/data/ipa_init.json
@@ -4846,6 +4846,11 @@
"ajax": {
"401": "Your kerberos ticket no longer valid.Please run KInit and then click 'retry'If this is your first time running the IPA Web UI<a href='/ipa/errors/ssbrowser.html'> Follow these directions</a> to configure your browser."
},
+ "association": {
+ "managedby": "Managed by",
+ "members": "Members",
+ "membershipin": "Membership in"
+ },
"button": {
"add": "Add",
"enroll": "Enroll",
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 708d829b..2e5d879b 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -97,6 +97,10 @@ class i18n_messages(Command):
"employee":_(" Employee Information"),
"misc":_("Misc. Information"),
"to_top":_("Back to Top")},
+ "association":{
+ "managedby":_("Managed by"),
+ "members":_("Members"),
+ "membershipin":_("Membership in")},
"ajax":{
"401":_("Your kerberos ticket no longer valid."+
"Please run KInit and then click 'retry'"+