]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1577] rewrite legacy path admin page
authorOlivier Lamy <olamy@apache.org>
Tue, 6 Mar 2012 18:32:33 +0000 (18:32 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 6 Mar 2012 18:32:33 +0000 (18:32 +0000)
ask confirmation before remove entry.

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

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html

index 55428825da98c72a9baa1c6633b8ff352e499d36..1160a0bea79504b152622c79917ac514c2e90c65 100644 (file)
@@ -203,21 +203,31 @@ $(function() {
     }
 
     removeLegacyArtifactPath=function(legacyArtifactPath){
-      $.ajax("restServices/archivaServices/archivaAdministrationService/deleteLegacyArtifactPath?path="+encodeURIComponent(legacyArtifactPath.path()),
-        {
-          type: "GET",
-          dataType: 'json',
-          success: function(data) {
-            self.legacyArtifactPaths.remove(legacyArtifactPath);
-            displaySuccessMessage($.i18n.prop('legacy-artifact-path.removed',legacyArtifactPath.path()));
-            activateLegacyArtifactPathsGridTab();
-          },
-          error: function(data) {
-            var res = $.parseJSON(data.responseText);
-            displayRestError(res);
-          }
-        }
-      );
+
+      openDialogConfirm(
+          function(){
+
+            $.ajax("restServices/archivaServices/archivaAdministrationService/deleteLegacyArtifactPath?path="+encodeURIComponent(legacyArtifactPath.path()),
+              {
+                type: "GET",
+                dataType: 'json',
+                success: function(data) {
+                  self.legacyArtifactPaths.remove(legacyArtifactPath);
+                  displaySuccessMessage($.i18n.prop('legacy-artifact-path.removed',legacyArtifactPath.path()));
+                  activateLegacyArtifactPathsGridTab();
+                },
+                error: function(data) {
+                  var res = $.parseJSON(data.responseText);
+                  displayRestError(res);
+                },
+                complete: function(){
+                  closeDialogConfirm();
+                }
+              }
+            );
+          }, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('legacy-artifact-path.delete.confirm',legacyArtifactPath.path()),
+                      $("#legacy-artifact-path-delete-warning-tmpl" ).tmpl(legacyArtifactPath));
+
     }
 
     updateLegacyArtifactPath=function(legacyArtifactPath){
index 9a39acc8d571bb0b6e3c180c794802f05acc5644..50330b4d11399af350100f851dc373db19998ad8 100644 (file)
     </form>
 </script>
 
+<script id="legacy-artifact-path-delete-warning-tmpl" type="text/html">
+    <div>
+      <span class="label label-warning">${$.i18n.prop('warning.not.undone.operation')}</span>
+    </div>
+</script>
+