]> source.dussan.org Git - archiva.git/commitdiff
fix groupId deletion message
authorOlivier Lamy <olamy@apache.org>
Wed, 5 Sep 2012 17:03:43 +0000 (17:03 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 5 Sep 2012 17:03:43 +0000 (17:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1381248 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/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html

index 9c56825a568c1324165c4661fd7db51b404f9dd0..718482076cec0926eb242fe55abe85b6403c1511 100644 (file)
@@ -270,6 +270,7 @@ artifact.delete.confirm.title=Artifact deletion
 artifact.delete.confirm.save=Are you sure to delete this artifact ?
 groupId.delete.confirm.title=GroupId deletion
 groupId.delete.confirm.save=Are you sure to delete groupId: {0} ?
+groupdId.deleted=groupId {0} deleted.
 groupId.delete.missing.repoId= You must select a repository to delete a groupId.
 browse.artifact.version=Version
 browse.artifact.pom.snippet=POM Snippet
index ae02c3a6fb7fc67419497e4469fa2a842724b72b..eddc9867c27452cd8262ecf54660c06f151dd13f 100644 (file)
@@ -86,6 +86,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
     }
 
     deleteGroupId=function(groupId){
+      var previousHash=getUrlHash();
+      $.log("previousHash:"+previousHash);
       var repoId=getSelectedBrowsingRepository();
       if(!repoId){
         displayErrorMessage($.i18n.prop('groupId.delete.missing.repoId'));
@@ -97,8 +99,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
           type:"GET",
           dataType:"json",
           success:function(data){
-
-
+            window.sammyArchivaApplication.setLocation(previousHash);
+            displaySuccessMessage( $.i18n.prop("groupdId.deleted", groupId));
           },
           error:function(data){
             displayRestError(data,"user-messages");
@@ -110,7 +112,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
       }, $.i18n.prop('ok'),
           $.i18n.prop('cancel'),
           $.i18n.prop('groupId.delete.confirm.title'),
-          $.i18n.prop('groupId.delete.confirm.save'));
+          $.i18n.prop('groupId.delete.confirm.save',groupId));
     }
   }
 
index 629ad78662877519c161a2d34435c9c2dbc506de..cfb60c885fc2daffe4e2bf88fc3f0c66e4f55d4d 100644 (file)
@@ -109,6 +109,11 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
     $(textId).focus();
   }
 
+  getUrlHash=function(){
+    var matches = window.location.toString().match(/^[^#]*(#.+)$/);
+    return matches ? matches[1] : null;
+  }
+
   /**
    * clear #main-content and call clearUserMessages
     */
index 271aefdad9de7210476a25a480dfa3b6e652069a..7dd83709ed3a044a81b5ad1df6993647b9a1b558 100644 (file)
       {{/if}}
       {{each(i,browseResultEntry) browseResultEntries}}
         {{if browseResultEntry.project}}
-          <li class="browse-list-project" data-bind="click:function(){displayProjectEntry(browseResultEntry.name)}">
-            <a href="#">${displayEntry(browseResultEntry.name)}</a>
-          </li>
+          {{if deleteKarma}}
+            <li class="browse-list-project">
+              <img src="images/trash.png" data-bind="click:function(){deleteGroupId(browseResultEntry.name)}"/>
+              <a href="#" data-bind="click:function(){displayProjectEntry(browseResultEntry.name)}">${displayEntry(browseResultEntry.name)}</a>
+            </li>
+          {{else}}
+            <li class="browse-list-project">
+              <a href="#" data-bind="click:function(){displayProjectEntry(browseResultEntry.name)}">${displayEntry(browseResultEntry.name)}</a>
+            </li>
+          {{/if}}
         {{else}}
           {{if deleteKarma}}
             <li class="browse-list">