add route to edit group directly

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1410357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-11-16 14:23:35 +00:00
parent 33b6f95108
commit f27178e792
2 changed files with 22 additions and 1 deletions

View File

@ -677,6 +677,14 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa
displayRepositoriesGrid(function(managedRepositoriesViewModel){managedRepositoriesViewModel.editManagedRepositoryWithId(repositoryId)});
});
this.get("#repositorygroupedit/:groupId",function(){
var groupId=this.params.groupId;
$.log("edit repository group:"+groupId);
displayRepositoryGroups(function(repositoryGroupsViewModel){repositoryGroupsViewModel.editRepositoryGroupWithId(groupId)});
});
});
};

View File

@ -127,6 +127,15 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
});
}
this.editRepositoryGroupWithId=function(repositoryGroupId){
$.each(self.repositoryGroups(), function(index, value) {
if(value.id()==repositoryGroupId){
self.editRepositoryGroup(value);
}
});
}
this.saveRepositoryGroup=function(repositoryGroup){
clearUserMessages();
$("#user-messages").html(mediumSpinnerImg());
@ -187,7 +196,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
}
displayRepositoryGroups=function(){
displayRepositoryGroups=function(successFn){
screenChange();
var mainContent = $("#main-content");
mainContent.html(mediumSpinnerImg());
@ -237,6 +246,10 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
});
if(successFn){
successFn(self.repositoryGroupsViewModel);
}
}
}
);