add: group list configuration (see issue #19)
authorRicardo Velhote <rvelhote@gmail.com>
Sat, 22 May 2010 11:40:03 +0000 (12:40 +0100)
committerRicardo Velhote <rvelhote@gmail.com>
Sat, 22 May 2010 11:40:03 +0000 (12:40 +0100)
swat/config/yaml/user-account-parameters.yaml
swat/templates/default/component/account-user-form.mako
swat/templates/default/derived/edit-user-account.mako

index 9c4061377da6c07bcee2c8c7a09ed159edd83c5a..78620f87db0b10fe33f7194a96d01ffd95ee5639 100644 (file)
@@ -180,7 +180,6 @@ homedirpath:
                 controller: share
                 action: path
 
-
 ##
 ## Home Directory Path
 ##
@@ -192,3 +191,39 @@ maphomedirdrive:
     label: 'Map Home to Drive'
     class: big-text
     id: account-homedir-path
+    
+##
+## Home Directory Path
+##
+groups:
+    type: list
+    help: 'List of Groups that this User belongs to'
+    title: 'Select the Groups that this User will be a part of'
+    name: share_group_list
+    label: 'Groups'
+    class: big-text
+    id: account-insert-groups
+    
+    field-ops:
+        - manual-add
+        - user-group-selection
+
+    field-ops-descriptor:
+        user-group-selection:
+            title: 'Open Group Selection Popup'
+            image:
+                name: users.png
+                alt: 'Select Users/Groups Icon'
+            link:
+                controller: share
+                action: users_groups
+                copy-to: account-insert-groups-list
+                
+        manual-add:
+            title: 'Assign this Group. Separate by , to add more than one'
+            image:
+                name: plus-small.png
+                alt: 'Add User/Group Icon'
+            link:
+                copy-from: account-insert-groups
+                copy-to: account-insert-groups-list
index 6573b886a76535bf56e4e8284cf354996da41c7a..6b57a1cd852c9cc243bc54c85ae076363d664881 100644 (file)
 
             <li id="content-tab4" class="tab">
                 <ol class="col-1">
+                    <%
+                    group_ids = []
+                    for g in c.user.group_list:
+                        group_ids.append(g.rid)
+                    %>
+                    <li>${field.put("groups", group_ids)}</li>
                 </ol>
             </li>
         </ul>
index 4a51e8d14dad78ba3e2398149af7e8cb00bb57e9..960631f29f42a9a826ffe4127c94c27acaf8b147 100644 (file)
@@ -35,6 +35,20 @@ ${form.write()}
         pathSelectors.each(function(p, i) {
             new PathSelector(popupId + "" + (i + 1), p);
         });
+        
+        var userGroupSelectors = $$("a.user-group-selection");
+        popupId = "usergroup-selector-";
+        userGroupSelectors.each(function(p, i) {
+            new UserGroupSelector(popupId + "" + (i + 1), p);
+        });
+        
+        var manualAdd = $$("a.manual-add");
+        manualAdd.each(function(p, i) {
+            var copyfrom = $(getUrlParam(p.getProperty("href"), "copyfrom"));
+            var copyto = $(getUrlParam(p.getProperty("href"), "copyto"));
+            
+            new ManualItemList({trigger: p, copyFrom: copyfrom, copyTo: copyto});
+        });
     });
 </script>