]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1574] delete managed repository
authorOlivier Lamy <olamy@apache.org>
Mon, 16 Jan 2012 22:56:42 +0000 (22:56 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 16 Jan 2012 22:56:42 +0000 (22:56 +0000)
ask confirmation for deleting content or not.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1232211 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html

index a3da7d21d38850cdd36186b0200c18faf9bd8946..37489eee38d5e22e334961ef16a3ae9482b65f1e 100644 (file)
@@ -23,6 +23,7 @@
 #default common
 id=id
 warning.not.undone.operation=WARNING: This operation can not be undone.
+managedrepository.delete.content=Delete Content too ?
 
 # managed repositories screen
 managedrepository.delete.confirm=Delete Managed Repository
index 69b4dfecca5a0fcb1b93b000c710484a0ded0ee2..4b8b0df378447d692d680118b7ff377149a3ca3d 100644 (file)
@@ -73,6 +73,7 @@ $(function() {
     this.managedRepository=ko.observable(managedRepository);
     this.managedRepositoriesViewModel = managedRepositoriesViewModel;
     this.update = update;
+    var self = this;
     save=function(){
       var valid = $("#main-content #managed-repository-edit-form").valid();
       if (valid==false) {
@@ -105,7 +106,7 @@ $(function() {
             data: "{\"managedRepository\": " +  ko.toJSON(this.managedRepository)+"}",
             dataType: 'json',
               success: function(data) {
-                this.managedRepositoriesViewModel.managedRepositories.push(mapManagedRepository(data));
+                self.managedRepositoriesViewModel.managedRepositories.push(mapManagedRepository(data));
                 displaySuccessMessage($.i18n.prop('managedrepository.added'));
               },
               error: function(data) {
@@ -159,7 +160,10 @@ $(function() {
           function(){
             var url = "restServices/archivaServices/managedRepositoriesService/deleteManagedRepository?";
             url += "repositoryId="+encodeURIComponent(managedRepository.id());
-            url += "&deleteContent=false";
+
+            var checked = $("#managedrepository-deletecontent").get(0).checked;
+
+            url += "&deleteContent="+(checked==true?"true":"false");
             $.ajax(url,
               {
                 type: "GET",
index 941cc6f29c8330db1257cca9a7631e52d93e985d..d1c36dce0d0ae30666e9c5a167491e7f42dc5b5d 100644 (file)
       <div>${$.i18n.prop('id')}: ${id()}</div>
       <div>${$.i18n.prop('name')}: ${name()}</div>
     </div>
+    <div>
+        ${$.i18n.prop('managedrepository.delete.content')}: <input type="checkbox" id="managedrepository-deletecontent">
+    </div>
   </div>
 </script>
\ No newline at end of file