[Freeipa-devel] [PATCH] admiyo-0112-entity-i18n

2010-12-06 Thread Adam Young
Note that this does not cover HBAC or SUDO, as Edewate is currently 
working on those.
From 07c07de994de1a22d38e270841f75a83b74f9c5c Mon Sep 17 00:00:00 2001
From: Adam Young ayo...@redhat.com
Date: Sat, 4 Dec 2010 00:29:05 -0500
Subject: [PATCH] entity i18n

Updated the user,group,host, hostgroup, netgroup, service, and all policy
entities to use the newer framework functions, in order to
replaced the old array style definitions which did not support i18n.
update a few of the newer framerwork functions to get the lables from the
meta data.

Fixed the unit tests which were expecting a details facet for users,
no longer automatically created
---
 install/static/details.js   |4 +-
 install/static/group.js |   37 ++
 install/static/host.js  |   29 ++---
 install/static/hostgroup.js |   65 +++---
 install/static/netgroup.js  |   60 ++---
 install/static/policy.js|  242 ++
 install/static/search.js|7 +
 install/static/service.js   |6 +-
 install/static/test/entity_tests.js |9 +-
 install/static/user.js  |  146 +-
 install/static/widget.js|   10 ++-
 11 files changed, 382 insertions(+), 233 deletions(-)

diff --git a/install/static/details.js b/install/static/details.js
index b6503a1c743eb39b26031c94283e05880f0fd12c..59b9aad9fb2d4d15239b2c8b8855043298e10c61 100644
--- a/install/static/details.js
+++ b/install/static/details.js
@@ -339,7 +339,7 @@ function ipa_details_list_section(spec){
 }
 };
 
-// Deprecated: Used for backward compatibility only.
+// This is to allow declarative style programming for details
 function input(spec){
 that.create_field(spec);
 return that;
@@ -350,7 +350,7 @@ function ipa_details_list_section(spec){
 return that;
 }
 
-// Deprecated: Used for backward compatibility only.
+// shorthand notation used for declarative definitions of details pages
 function ipa_stanza(spec) {
 return ipa_details_list_section(spec);
 }
diff --git a/install/static/group.js b/install/static/group.js
index b44463439d73d6059b32751c07530c41b6d1a4dc..8c2087f66f3ca4a9feac2001aba18ec0d446eb7b 100644
--- a/install/static/group.js
+++ b/install/static/group.js
@@ -89,10 +89,14 @@ function ipa_group_add_dialog(spec) {
 
 that.add_dialog_init();
 
-that.add_field(ipa_text_widget({name:'cn', label:'Name', undo: false}));
-that.add_field(ipa_text_widget({name:'description', label:'Description', undo: false}));
-that.add_field(ipa_checkbox_widget({name:'posix', label:'Is this a POSIX group?', undo: false}));
-that.add_field(ipa_text_widget({name:'gidnumber', label:'GID', undo: false}));
+that.add_field(ipa_text_widget({name:'cn', entity_name:'group',
+undo: false}));
+that.add_field(ipa_text_widget({name:'description',
+entity_name:'group', undo: false}));
+that.add_field(ipa_checkbox_widget({name:'posix', entity_name:'group',
+undo: false}));
+that.add_field(ipa_text_widget({name:'gidnumber', entity_name:'group',
+undo: false}));
 };
 
 return that;
@@ -105,11 +109,9 @@ function ipa_group_search_facet(spec) {
 var that = ipa_search_facet(spec);
 
 that.init = function() {
-
-that.create_column({name:'cn', label:'Name'});
-that.create_column({name:'gidnumber', label:'GID'});
-that.create_column({name:'description', label:'Description'});
-
+that.create_column({name:'cn'});
+that.create_column({name:'gidnumber'});
+that.create_column({name:'description'});
 that.search_facet_init();
 };
 
@@ -130,20 +132,9 @@ function ipa_group_details_facet(spec) {
 });
 that.add_section(section);
 
-section.create_field({
-name: 'cn',
-label: 'Group Name'
-});
-
-section.create_field({
-name: 'description',
-label: 'Description'
-});
-
-section.create_field({
-name: 'gidnumber',
-label: 'Group ID'
-});
+section.create_field({name: 'cn' });
+section.create_field({name: 'description'});
+section.create_field({name: 'gidnumber' });
 
 that.details_facet_init();
 };
diff --git a/install/static/host.js b/install/static/host.js
index 484b64771ecf6f1be948974f424606476375a276..4a60bbccd3ca965f2ff8263e3859d6ac4710e2cc 100644
--- a/install/static/host.js
+++ b/install/static/host.js
@@ -87,7 +87,7 @@ function ipa_host_add_dialog(spec) {
 
 that.add_field(ipa_text_widget({
 'name': 'fqdn',
-'label': 'Name',
+entity_name:'host',
 'size': 40,
 'undo': false
 }));
@@ 

Re: [Freeipa-devel] [PATCH] admiyo-0112-entity-i18n

2010-12-06 Thread Endi Sukma Dewata

On 12/6/2010 11:16 AM, Adam Young wrote:

Note that this does not cover HBAC or SUDO, as Edewate is currently
working on those.


ACK and pushed to master.

--
Endi S. Dewata

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