aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-05 17:03:43 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-05 17:03:43 +0000
commit4b3d3b015e88fd46fa8e628aeb500123c3f40fd6 (patch)
treebd670ce6e968663df2422355e0beee2f07661e8b
parent7e28f6b4cd8c3820a21b49dc5a9f6f810fb042ee (diff)
downloadarchiva-4b3d3b015e88fd46fa8e628aeb500123c3f40fd6.tar.gz
archiva-4b3d3b015e88fd46fa8e628aeb500123c3f40fd6.zip
fix groupId deletion message
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1381248 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties1
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js8
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js5
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html13
4 files changed, 21 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
index 9c56825a5..718482076 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
+++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
@@ -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
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
index ae02c3a6f..eddc9867c 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
@@ -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));
}
}
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
index 629ad7866..cfb60c885 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
@@ -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
*/
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
index 271aefdad..7dd83709e 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
@@ -50,9 +50,16 @@
{{/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">