You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/01/12 15:12:32 UTC

svn commit: r1230555 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js: archiva/utils.js redback/templates/user-edit.html

Author: olamy
Date: Thu Jan 12 14:12:32 2012
New Revision: 1230555

URL: http://svn.apache.org/viewvc?rev=1230555&view=rev
Log:
user roles edit display roles from templates/resources

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-edit.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js?rev=1230555&r1=1230554&r2=1230555&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js Thu Jan 12 14:12:32 2012
@@ -206,4 +206,11 @@ mapStringArray=function(data){
     }
   }
   return null;
-}
\ No newline at end of file
+}
+
+// extends jquery tmpl to support var def
+$.extend($.tmpl.tag, {
+    "var": {
+        open: "var $1;"
+    }
+});
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-edit.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-edit.html?rev=1230555&r1=1230554&r2=1230555&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-edit.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-edit.html Thu Jan 12 14:12:32 2012
@@ -109,9 +109,34 @@
       </blockquote>
       <ul>
       {{each $value.globalRoles}}
-        <li><div><input type="checkbox" value="${$value}" data-bind="checked: user.assignedRoles" />&nbsp;${$value}</div></li>
+        <li><input type="checkbox" value="${$value}" data-bind="checked: user.assignedRoles">&nbsp;${$value}</input></li>
       {{/each}}
       </ul>
+
+      {{if roleTemplates}}
+      <table class="bordered-table">
+        <thead>
+          <tr>
+            <th>&nbsp;</th>
+            {{each roleTemplates}}
+              <th>${$value.namePrefix}</th>
+            {{/each}}
+          </tr>
+        </thead>
+        <tbody>
+          {{each resources}}
+            {{var curResource = $value}}
+            <tr>
+              <td>${curResource}</td>
+              {{each roleTemplates}}
+                <td><input type="checkbox" value="${$value.namePrefix}${$value.delimiter}${curResource}" data-bind="checked: user.assignedRoles"/></td>
+              {{/each}}
+            </tr>
+          {{/each}}
+        </tbody>
+      </table>
+      {{/if}}
+
     {{/each}}
 
     <button class="btn" data-bind="click:updateUserRoles">${$.i18n.prop('update')}</button>