]> source.dussan.org Git - archiva.git/commitdiff
role description is now updatable
authorOlivier Lamy <olamy@apache.org>
Sat, 31 Dec 2011 13:55:25 +0000 (13:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 31 Dec 2011 13:55:25 +0000 (13:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1226091 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 10c37d57a7e2837972e17f7305e8037ff68eb857..4bdb74a59a5327428e7018e101066acb98a0e0bc 100644 (file)
@@ -64,6 +64,29 @@ $(function() {
     );
   }
 
+  saveRoleDescription=function(){
+    var roleName = $("#editRoleTable #role-edit-name").html();
+    var description = $("#editRoleTable #role-edit-description").val();
+    clearUserMessages();
+    var url = "restServices/redbackServices/roleManagementService/updateRoleDescription?";
+    url += "roleName="+encodeURIComponent(roleName);
+    url += "&roleDescription="+encodeURIComponent(description);
+    $.ajax(url,
+      {
+        type: "GET",
+        dataType: 'json',
+        success: function(data) {
+          $.log("role description updated");
+          displaySuccessMessage($.i18n.prop("role.updated",roleName));
+        },
+        error: function(data){
+          displayErrorMessage("error updating role description");
+        }
+      }
+    );
+
+  }
+
   /**
    * @param data Role response from redback rest api
    */
index 4b242335d75a5897bffcdf5e2a761462cbf2331d..6401cd91ffae55f94f7049de4182062f1e2a596c 100644 (file)
     <tbody>
       <tr>
         <td>${$.i18n.prop('name')}:</td>
-        <td>${name}</td>
+        <td id="role-edit-name">${name}</td>
       </tr>
       <tr>
         <td>${$.i18n.prop('description')}:</td>
-        <td>${description}</td>
+        <td><input type="text" id="role-edit-description" value="${description}"></td>
+      </tr>
+      <tr>
+        <td colspan="2">
+          <div class="pull-left">
+            <button class="btn" onclick="saveRoleDescription();">${$.i18n.prop('save')}</button>
+          </div>
+        </td>
       </tr>
     </tbody>
   </table>