summaryrefslogtreecommitdiffstats
path: root/install/static/group.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-11-09 14:22:31 -0600
committerAdam Young <ayoung@redhat.com>2010-11-11 12:23:05 -0500
commit65c9442e2697f9e5d8b6cc2b7c22a6b8da426247 (patch)
treea998aa317a59102646fada66a4944d022ff2afa5 /install/static/group.js
parent569f4e1a5cb3ff4cf3a7bf3c2aa5fdfa9ced0134 (diff)
downloadfreeipa-65c9442e2697f9e5d8b6cc2b7c22a6b8da426247.tar.gz
freeipa-65c9442e2697f9e5d8b6cc2b7c22a6b8da426247.tar.xz
freeipa-65c9442e2697f9e5d8b6cc2b7c22a6b8da426247.zip
HBAC Services
The HBAC Service search and details pages have been added under the HBAC tab. This requires some changes to the framework. Currently the navigation framework doesn't support multiple entities under one tab. As a temporary solution, an 'entity' URL parameter is used to determine the entity to be displayed. This parameter is now only used by HBAC tab, but its use might be expanded later. The navigation framework needs be redesigned to provide more flexibility. The search page in all entities except DNS records have been changed to use the ipa_search_widget. The Select/Unselect All checbox and Delete button now work correctly and consistently. The Add dialog has been enhanced to render and work in a more consistent way while still supporting custom widgets & layouts. For the search page, the Add button will refresh the search results and clear the fields in the dialog box. The framework now provides some extension points which can be overriden by the subclasses: - init(): for initialization and configuration - create(): for creating the layout dynamically or from template - setup(): for setting the look and feel - load(): for loading the data Entity and facet initialization is now done after IPA.init(). This is to ensure the metadata is loaded first so the entities and facets can use localized messages/labels/titles. The group entity has been partially converted to use the new framework. The unit tests have been updated accordingly.
Diffstat (limited to 'install/static/group.js')
-rw-r--r--install/static/group.js76
1 files changed, 46 insertions, 30 deletions
diff --git a/install/static/group.js b/install/static/group.js
index 1d1e9b5c..97f498ae 100644
--- a/install/static/group.js
+++ b/install/static/group.js
@@ -20,6 +20,52 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
+function ipa_group() {
+
+ var that = ipa_entity({
+ 'name': 'group'
+ });
+
+ that.super_init = that.super('init');
+
+ that.init = function() {
+
+ var dialog = ipa_group_add_dialog({
+ 'name': 'add',
+ 'title': 'Add New Group'
+ });
+ that.add_dialog(dialog);
+ dialog.init();
+
+ that.super_init();
+ };
+
+ return that;
+}
+
+IPA.add_entity(ipa_group());
+
+function ipa_group_add_dialog(spec) {
+
+ spec = spec || {};
+
+ var that = ipa_add_dialog(spec);
+
+ that.super_init = that.super('init');
+
+ that.init = function() {
+
+ this.super_init();
+
+ this.add_field(ipa_text_widget({name:'cn', label:'Name'}));
+ this.add_field(ipa_text_widget({name:'description', label:'Description'}));
+ this.add_field(ipa_checkbox_widget({name:'posix', label:'Is this a POSIX group?'}));
+ this.add_field(ipa_text_widget({name:'gidnumber', label:'GID'}));
+ };
+
+ return that;
+}
+
ipa_entity_set_search_definition('group', [
['cn', 'Name', null],
['gidnumber', 'GID', null],
@@ -27,15 +73,6 @@ ipa_entity_set_search_definition('group', [
['quick_links', 'Quick Links', ipa_entity_quick_links]
]);
-ipa_entity_set_add_definition('group', [
- 'dialog-add-group', 'Add New Group', [
- ['cn', 'Name', null],
- ['description', 'Description', null],
- ['posix', 'Is this a POSIX group?', f_posix],
- ['gidnumber', 'GID', null]
- ]
-]);
-
ipa_entity_set_details_definition('group',[
ipa_stanza({name:'identity', label:'Group Details'}).
input({name:'cn', label:'Group Name'}).
@@ -48,24 +85,3 @@ ipa_entity_set_association_definition('group', {
'rolegroup': { associator: 'serial' },
'taskgroup': { associator: 'serial' }
});
-
-function f_posix(dlg, mode)
-{
- function checkbox_on_click() {
- var jobj = $(this);
- if (jobj.attr('checked'))
- jobj.attr('checked', false);
- else
- jobj.attr('checked', true);
- };
-
- if (mode == IPA_ADD_POPULATE) {
- dlg.append('<label>Is this a POSIX group?</label>');
- dlg.append('<input type="checkbox" name="posix" />');
- dlg.children().last().click(checkbox_on_click);
- } else {
- if (dlg.find('input:checkbox[name=posix]').attr('checked'))
- return (true);
- return (false);
- }
-}