]> source.dussan.org Git - archiva.git/commitdiff
display roles in a table
authorOlivier Lamy <olamy@apache.org>
Mon, 26 Dec 2011 15:06:41 +0000 (15:06 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 26 Dec 2011 15:06:41 +0000 (15:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1224735 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html [new file with mode: 0644]

index 0fed206a7fb7087f20fa077eee8adeb95a752b77..ff7537db7cad345e111af730061a6f28249a3d16 100644 (file)
@@ -18,8 +18,8 @@
  */
 require(["text!redback/templates/user-edit.html", "text!redback/templates/user-grids.html", "text!redback/templates/login.html"
           , "text!redback/templates/register-form.html","text!redback/templates/password-change-form.html"
-          ,"text!redback/templates/user-edit-form.html"],
-    function(usercreate, usergrids, login,register,passwordchange,useredit) {
+          ,"text!redback/templates/user-edit-form.html","text!redback/templates/roles-tmpl.html"],
+    function(usercreate, usergrids, login,register,passwordchange,useredit,roles_tmpl) {
 
 
       $.tmpl( login, $.i18n.map ).appendTo("#html-fragments");
@@ -29,5 +29,7 @@ require(["text!redback/templates/user-edit.html", "text!redback/templates/user-g
       // template loading
       $("#html-fragments").append(usercreate);
       $("#html-fragments").append(usergrids);
+      $("#html-fragments").append(roles_tmpl);
+
     }
 );
\ No newline at end of file
index f28b59216fd97cd58d681ab6911a4f1dfbfac107..c7a84b88883ae7bfb09d9ff7482275067ae47c17 100644 (file)
@@ -24,6 +24,8 @@ $(function() {
   }
 
   displayRolesGrid = function(){
+    $("#user-messages").html("");
+    $("#main-content").html("");
     $.ajax("restServices/redbackServices/roleManagementService/allRoles",
       {
        type: "GET",
@@ -33,6 +35,8 @@ $(function() {
          var roles = $.map(data.role, function(item) {
              return mapRole(item);
          });
+         $("#main-content").html($("#rolesGrid").tmpl(data));
+
        }
       }
     );
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
new file mode 100644 (file)
index 0000000..e2bda0e
--- /dev/null
@@ -0,0 +1,18 @@
+<script id="rolesGrid"  type="text/x-jquery-tmpl">
+  <table class="bordered-table zebra-striped" id="rolesTable">
+    <thead>
+      <tr>
+        <td>${$.i18n.prop('roles.name')}</td>
+        <td>${$.i18n.prop('roles.description')}</td>
+      </tr>
+    </thead>
+    <tbody>
+      {{each role}}
+        <tr>
+          <td>${$value.name}</td>
+          <td>${$value.description}</td>
+        </tr>
+      {{/each}}
+    </tbody>
+  </table>
+</script>
\ No newline at end of file