archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1225238 - /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
Date Wed, 28 Dec 2011 17:11:22 GMT
Author: olamy
Date: Wed Dec 28 17:11:22 2011
New Revision: 1225238

URL: http://svn.apache.org/viewvc?rev=1225238&view=rev
Log:
fix impl of role edit view when operations or resources are not array but a single one

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html?rev=1225238&r1=1225237&r2=1225238&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
Wed Dec 28 17:11:22 2011
@@ -62,20 +62,32 @@
   <div class="page-header">
     <h3>${$.i18n.prop('role.parents')}</h3>
   </div>
-  <ul>
-  {{each parentRoleNames}}
-    <li>${$value}</li>
-  {{/each}}
-  </ul>
+  {{if childRoleNames}}
+    <ul>
+      {{if $.isArray(childRoleNames)}}
+        {{each parentRoleNames}}
+          <li>${$value}</li>
+        {{/each}}
+      {{else}}
+        <li>${childRoleNames}</li>
+      {{/if}}
+    </ul>
+  {{/if}}
 
   <div class="page-header">
     <h3>${$.i18n.prop('role.childs')}</h3>
   </div>
-  <ul>
-    {{each childRoleNames}}
-      <li>${$value}</li>
-    {{/each}}
-  </ul>
+  {{if childRoleNames}}
+    <ul>
+      {{if $.isArray(childRoleNames)}}
+        {{each childRoleNames}}
+          <li>${$value}</li>
+        {{/each}}
+      {{else}}
+        <li>${childRoleNames}</li>
+      {{/if}}
+    </ul>
+  {{/if}}
 
   {{if permissions}}
     <div class="page-header">
@@ -90,13 +102,21 @@
         </tr>
       </thead>
       <tbody>
-        {{each permissions}}
+        {{if $.isArray(permissions)}}
+          {{each permissions}}
+            <tr>
+              <td>${$value.name}</td>
+              <td>${$value.operation.name}</td>
+              <td>${$value.resource.identifier}</td>
+            </tr>
+          {{/each}}
+        {{else}}
           <tr>
-            <td>${$value.name}</td>
-            <td>${$value.operation.name}</td>
-            <td>${$value.resource.identifier}</td>
+            <td>${permissions.name}</td>
+            <td>${permissions.operation.name}</td>
+            <td>${permissions.resource.identifier}</td>
           </tr>
-        {{/each}}
+        {{/if}}
       </tbody>
     </table>
   {{/if}}



Mime
View raw message