]> source.dussan.org Git - archiva.git/commitdiff
confirm modal on repository group delete
authorOlivier Lamy <olamy@apache.org>
Sun, 26 Feb 2012 23:06:30 +0000 (23:06 +0000)
committerOlivier Lamy <olamy@apache.org>
Sun, 26 Feb 2012 23:06:30 +0000 (23:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1293954 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/repository-groups.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repository-groups.html

index f45b5ff21eaf7db58231575a8c04d438c0fea140..b6443366ceca65955bcc5a49d36428f850f6a45f 100644 (file)
@@ -177,6 +177,7 @@ repository.group.added=Repository Group {0} added.
 repository.groups.available.repositories=Available Repositories
 repository.groups.list=Repository Groups
 repository-groups.grid.tab.title=Repository Groups
+repository.group.delete.confirm=Are you sure to delete Repository Group {0} ?
 
 #roles
 roles.bulk.save.confirm=Are you sure to update {0} Role(s)
index 4ef600ff6aefda11632581d40f86eec3f82d399c..26c68b6d1fb74c2cb192eac63a9dc9bc759252b3 100644 (file)
@@ -80,8 +80,14 @@ $(function() {
     this.findManagedRepository=function(id){
       return findManagedRepository(id,self.managedRepositories());
     }
-
     this.deleteRepositoryGroup=function(repositoryGroup){
+      openDialogConfirm(
+          function(){self.removeRepositoryGroup(repositoryGroup);window.modalConfirmDialog.modal('hide')},
+          $.i18n.prop('ok'), $.i18n.prop('cancel'),
+          $.i18n.prop('repository.group.delete.confirm',repositoryGroup.id()),
+          $("#repository-group-location-warning-tmpl").tmpl(self.repositoryGroup));
+    }
+    this.removeRepositoryGroup=function(repositoryGroup){
       clearUserMessages();
       $.ajax("restServices/archivaServices/repositoryGroupService/deleteRepositoryGroup/"+encodeURIComponent(repositoryGroup.id()),
         {
index 922b0b712bbbdfec8742c2dc4e64ebe1ded415ec..eeb4cb5a7ae5bec86eabbd4b187c9a7f1c1e714c 100644 (file)
     </blockquote>
 
   </div>
+</script>
+
+<script id="repository-group-location-warning-tmpl" type='text/x-jquery-tmpl'>
+    <div>
+      <span class="label label-warning">${$.i18n.prop('warning.not.undone.operation')}</span>
+    </div>
 </script>
\ No newline at end of file