Fixing project renaming and deleting
parent
dab4bc9a95
commit
3b95376686
|
@ -106,7 +106,7 @@ module.controller("ProjectProfileController", ProjectProfileController)
|
|||
## Project Profile Directive
|
||||
#############################################################################
|
||||
|
||||
ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) ->
|
||||
ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, projectsService) ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
form = $el.find("form").checksley({"onlyOneErrorElement": true})
|
||||
submit = debounce 2000, (event) =>
|
||||
|
@ -123,6 +123,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) ->
|
|||
newUrl = $navurls.resolve("project-admin-project-profile-details", {project: $scope.project.slug})
|
||||
$location.path(newUrl)
|
||||
$scope.$emit("project:loaded", $scope.project)
|
||||
projectsService.fetchProjects()
|
||||
|
||||
promise.then null, (data) ->
|
||||
$loading.finish(submitButton)
|
||||
|
@ -136,8 +137,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) ->
|
|||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation",
|
||||
ProjectProfileDirective])
|
||||
module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", "tgProjects", ProjectProfileDirective])
|
||||
|
||||
#############################################################################
|
||||
## Project Default Values Directive
|
||||
|
|
|
@ -150,7 +150,7 @@ module.directive("tgLbCreateProject", ["$rootScope", "$tgRepo", "$tgConfirm",
|
|||
## Delete Project Lightbox Directive
|
||||
#############################################################################
|
||||
|
||||
DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confirm, lightboxService, tgLoader) ->
|
||||
DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confirm, lightboxService, tgLoader, projectsService) ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
projectToDelete = null
|
||||
$scope.$on "deletelightbox:new", (ctx, project)->
|
||||
|
@ -171,6 +171,7 @@ DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confir
|
|||
$rootscope.$broadcast("projects:reload")
|
||||
$location.path($navUrls.resolve("home"))
|
||||
$confirm.notify("success")
|
||||
projectsService.fetchProjects()
|
||||
|
||||
# FIXME: error handling?
|
||||
promise.then null, ->
|
||||
|
@ -188,4 +189,4 @@ DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confir
|
|||
return {link:link}
|
||||
|
||||
module.directive("tgLbDeleteProject", ["$tgRepo", "$rootScope", "$tgAuth", "$tgLocation", "$tgNavUrls",
|
||||
"$tgConfirm", "lightboxService", "tgLoader", DeleteProjectDirective])
|
||||
"$tgConfirm", "lightboxService", "tgLoader", "tgProjects", DeleteProjectDirective])
|
||||
|
|
Loading…
Reference in New Issue