From 948527a7bdf34a6803702e25de93d70f4fe2adff Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 5 Sep 2012 17:03:02 +0000 Subject: [PATCH] deleting groupId tru the ui git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1381246 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/search.js | 32 +++++++++++++++++++ .../webapp/js/templates/archiva/search.html | 17 +++++++--- 2 files changed, 45 insertions(+), 4 deletions(-) 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 367e7cac6..ae02c3a6f 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 @@ -80,6 +80,38 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno } return value; } + + deleteKarma=function(){ + return hasKarma('archiva-delete-artifact'); + } + + deleteGroupId=function(groupId){ + var repoId=getSelectedBrowsingRepository(); + if(!repoId){ + displayErrorMessage($.i18n.prop('groupId.delete.missing.repoId')); + return; + } + openDialogConfirm(function(){ + $.ajax({ + url:"restServices/archivaServices/repositoriesService/deleteGroupId?groupId="+groupId+"&repositoryId="+repoId, + type:"GET", + dataType:"json", + success:function(data){ + + + }, + error:function(data){ + displayRestError(data,"user-messages"); + }, + complete:function(){ + closeDialogConfirm(); + } + }); + }, $.i18n.prop('ok'), + $.i18n.prop('cancel'), + $.i18n.prop('groupId.delete.confirm.title'), + $.i18n.prop('groupId.delete.confirm.save')); + } } calculateBreadCrumbEntries=function(groupId){ 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 b5907b124..271aefdad 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 @@ -52,11 +52,20 @@ {{if browseResultEntry.project}}
  • ${displayEntry(browseResultEntry.name)} - {{else}} -
  • - ${displayEntry(browseResultEntry.name)} - {{/if}}
  • + {{else}} + {{if deleteKarma}} +
  • + + ${displayEntry(browseResultEntry.name)} +
  • + {{else}} +
  • + ${displayEntry(browseResultEntry.name)} +
  • + {{/if}} + {{/if}} + {{/each}}