Scarab commit: svn commit: r10289 - trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: jorgeuriarte
Date: 2006-09-08 15:23:23-0700
New Revision: 10289

Modified:
   trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm

Log:
Added a checkbox in the header of the module/role matrix, to control the whole column. Provided by Holger Hartwig. Thanks.

Modified: trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm?view=diff&rev=10289&p1=trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm&p2=trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm&r1=10288&r2=10289
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/screens/admin/EditUserRoles.vm	2006-09-08 15:23:23-0700
@@ -6,6 +6,20 @@
 #set ($user = $securityAdmin.getUserByUsername($username))
 #set ($acl = $user.getACL())
 
+<script type="text/javascript">
+function checkAll( name, checked ) {
+  var list = document.getElementsByTagName("input");
+  for( var i = 0; i < list.length; ++i) { 
+    var len = list[i].name.length - name.length;
+    if (len > 0) {
+      if (list[i].type == "checkbox" && list[i].name.substr(len) == name) {
+        list[i].checked  = checked;
+      }
+    }
+  }
+}
+</script>
+
 <div id="adduser" class="app">
 
 <h3>$l10n.UserRoles</h3>
@@ -26,6 +40,9 @@
     #foreach ($role in $securityAdmin.Roles)
     <td bgcolor="#ffffff">
         <b>$role.Name</b>
+        <script>
+        document.writeln("<br/><center><input type=\"checkbox\" onclick=\"checkAll('$role.Name', this.checked);\" /></center>");
+        </script>
     </td>
     #end
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.