The sudo rule interface has been modified to remove unused labels
and use translated dialog box title.

Ticket #1518

--
Endi S. Dewata
From b0c85d3ffc2c72009b4b50b8b189992d570c5ff7 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Tue, 26 Jul 2011 11:42:25 -0500
Subject: [PATCH] Fixed hard-coded labels in sudo rules.

The sudo rule interface has been modified to remove unused labels
and use translated dialog box title.

Ticket #1518
---
 install/ui/sudo.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 30479fb11f09b7e46bb3ba633a136ddf19023449..83467773a1d3e662b02f34024b9334bff45ec3cb 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -892,25 +892,25 @@ IPA.sudo.rule_details_command_section = function(spec) {
 
         that.add_field(IPA.rule_association_table_widget({
             'id': that.entity_name+'-memberallowcmd_sudocmd',
-            'name': 'memberallowcmd_sudocmd', 'label': 'Command',
+            'name': 'memberallowcmd_sudocmd',
             'category': category,
             'other_entity': 'sudocmd', 'add_method': 'add_allow_command', 'remove_method': 'remove_allow_command'
         }));
         that.add_field(IPA.rule_association_table_widget({
             'id': that.entity_name+'-memberallowcmd_sudocmdgroup',
-            'name': 'memberallowcmd_sudocmdgroup', 'label': 'Groups',
+            'name': 'memberallowcmd_sudocmdgroup',
             'category': category,
             'other_entity': 'sudocmdgroup', 'add_method': 'add_allow_command', 'remove_method': 'remove_allow_command'
         }));
 
         that.add_field(IPA.rule_association_table_widget({
             'id': that.entity_name+'-memberdenycmd_sudocmd',
-            'name': 'memberdenycmd_sudocmd', 'label': 'Command',
+            'name': 'memberdenycmd_sudocmd',
             'other_entity': 'sudocmd', 'add_method': 'add_deny_command', 'remove_method': 'remove_deny_command'
         }));
         that.add_field(IPA.rule_association_table_widget({
             'id': that.entity_name+'-memberdenycmd_sudocmdgroup',
-            'name': 'memberdenycmd_sudocmdgroup', 'label': 'Groups',
+            'name': 'memberdenycmd_sudocmdgroup',
             'other_entity': 'sudocmdgroup', 'add_method': 'add_deny_command', 'remove_method': 'remove_deny_command'
         }));
 
@@ -1269,9 +1269,13 @@ IPA.sudorule_association_table_widget = function(spec) {
     that.external = spec.external;
 
     that.create_add_dialog = function() {
+
         var pkey = IPA.nav.get_state(that.entity_name+'-pkey');
-        var label = IPA.metadata.objects[that.other_entity].label;
-        var title = 'Add '+label+' to '+that.entity_name+' '+pkey;
+
+        var title = IPA.messages.association.add;
+        title = title.replace('${other_entity}', IPA.metadata.objects[that.other_entity].label);
+        title = title.replace('${entity}', IPA.metadata.objects[that.entity_name].label_singular);
+        title = title.replace('${primary_key}', pkey);
 
         return IPA.sudo.rule_association_adder_dialog({
             'title': title,
-- 
1.7.5.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to