From 11ff892c057b1bcf22762398deffe86a22a0aae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Mon, 11 Aug 2014 18:42:08 +0200 Subject: [PATCH] Fixed bug #350: Now on change slug, redirect the user to the new valid project url --- app/coffee/modules/admin/project-profile.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee index b8af6bd9..9e13a897 100644 --- a/app/coffee/modules/admin/project-profile.coffee +++ b/app/coffee/modules/admin/project-profile.coffee @@ -85,7 +85,7 @@ module.controller("ProjectProfileController", ProjectProfileController) ## Project Profile Directive ############################################################################# -ProjectProfileDirective = ($log, $repo, $confirm) -> +ProjectProfileDirective = ($log, $repo, $confirm, $location) -> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley() submit = => @@ -94,6 +94,7 @@ ProjectProfileDirective = ($log, $repo, $confirm) -> promise = $repo.save($scope.project) promise.then -> $confirm.notify("success") + $location.path("/project/#{$scope.project.slug}/admin/project-profile/details") promise.then null, (data) -> form.setErrors(data) @@ -152,5 +153,5 @@ ProjectFeaturesDirective = ($log, $repo, $confirm) -> return {link:link} -module.directive("tgProjectProfile", ["$log", "$tgRepo", "$tgConfirm", ProjectProfileDirective]) +module.directive("tgProjectProfile", ["$log", "$tgRepo", "$tgConfirm", "$location", ProjectProfileDirective]) module.directive("tgProjectFeatures", ["$log", "$tgRepo", "$tgConfirm", ProjectFeaturesDirective])