Updating url when editing project slug

stable
Alejandro Alonso 2014-10-20 13:49:35 +02:00
parent c390c55252
commit 7585b8bc88
1 changed files with 4 additions and 2 deletions

View File

@ -96,7 +96,7 @@ module.controller("ProjectProfileController", ProjectProfileController)
## Project Profile Directive ## Project Profile Directive
############################################################################# #############################################################################
ProjectProfileDirective = ($repo, $confirm, $loading) -> ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
form = $el.find("form").checksley({"onlyOneErrorElement": true}) form = $el.find("form").checksley({"onlyOneErrorElement": true})
submit = (target) => submit = (target) =>
@ -108,6 +108,8 @@ ProjectProfileDirective = ($repo, $confirm, $loading) ->
promise.then -> promise.then ->
$loading.finish(target) $loading.finish(target)
$confirm.notify("success") $confirm.notify("success")
newUrl = $navurls.resolve("project-admin-project-profile-details", {project: $scope.project.slug})
$location.path(newUrl)
$scope.$emit("project:loaded", $scope.project) $scope.$emit("project:loaded", $scope.project)
promise.then null, (data) -> promise.then null, (data) ->
@ -132,7 +134,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading) ->
return {link:link} return {link:link}
module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", ProjectProfileDirective]) module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", ProjectProfileDirective])
############################################################################# #############################################################################