back to users grid tab after user creation

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1215291 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-12-16 21:29:14 +00:00
parent 8cf86eda66
commit 531dcdaa61
2 changed files with 7 additions and 2 deletions

View File

@ -93,7 +93,7 @@
Sort by name
</button>
<ul id="users-view-tabs" class="tabs">
<li class="active">
<li class="active" id="users-view-tabs-li-tabs">
<a href="#users-view">Users</a>
</li>
<li>

View File

@ -60,12 +60,17 @@ $(function() {
dataType: 'json',
success: function(result) {
var created = JSON.parse(result);
// FIXME use a message div and i18n
if (created == true) {
displaySuccessMessage("user created:"+currentUser.username());
window.redbackModel.usersViewModel.users.push(currentUser);
clearForm("#main-content #user-create");
$("#main-content #user-create").hide();
$("#main-content #users-view-tabs li").removeClass("active");
$("#main-content #users-view-tabs-content div").removeClass("active");
// activate users grid tab
$("#main-content #users-view-tabs-content #users-view").addClass("active");
$("#users-view-tabs-li-tabs").addClass("active");
return this;
} else {
displayErrorMessage("user cannot created");