]> source.dussan.org Git - archiva.git/commitdiff
roles screen add a column to save modified roles
authorOlivier Lamy <olamy@apache.org>
Mon, 13 Feb 2012 08:57:55 +0000 (08:57 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 13 Feb 2012 08:57:55 +0000 (08:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1243439 13f79535-47bb-0310-9956-ffa450edef68

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

index ebf0390e4e155716bc4cb5234f8f3c58d392bfec..51fcce8233397d443216252ba2d6c9c6307d1c16 100644 (file)
@@ -179,6 +179,17 @@ $(function() {
       }
     }
 
+    updateRole=function(modifiedRole){
+      if (modifiedRole.modified()){
+        modifiedRole.updateDescription();
+        modifiedRole.modified(false);
+      }
+      if (modifiedRole.usersModified()){
+        modifiedRole.updateUsers();
+        modifiedRole.usersModified(false);
+      }
+    }
+
   }
 
   displayRolesGrid = function(){
index 8113a78fc450d159b8efb253a0552af8608bb4ed..bcccfbfd4c0df724c4ee378426bb35416d50270e 100644 (file)
           <th>${ columnDefinition.headerText }</th>
         {{/each}}
         <th>${$.i18n.prop('edit')}</th>
+        <th>${$.i18n.prop('save')}</th>
       </tr>
   </thead>
   <tbody>
               <td>
                 <a id="edit-role-${row.name()}" href="#" data-bind="click: function(){ editRole(row) }">${$.i18n.prop('edit')}</a>
               </td>
+              <td>
+                {{if row.modified()}}
+                  <a href="#" class="btn" data-bind="click: function(){ updateRole(row) }">${$.i18n.prop('save')}</a>
+                {{/if}}
+              </td>
           </tr>
       {{/each}}
   </tbody>