 ## Leave project Directive
 #############################################################################
 
-LeaveProjectDirective = ($repo, $confirm, $location, $rs, $navurls, $translate, lightboxFactory) ->
+LeaveProjectDirective = ($repo, $confirm, $location, $rs, $navurls, $translate, lightboxFactory, currentUserService) ->
     link = ($scope, $el, $attrs) ->
         leaveConfirm = () ->
             leave_project_text = $translate.instant("TEAM.ACTION_LEAVE_PROJECT")

                promise = $rs.projects.leave($scope.project.id)

                promise.then =>
                    response.finish()
                    $confirm.notify("success")
                    $location.path($navurls.resolve("home"))

                promise.then null, (response) ->
                    response.finish()

        link: link
    }

module.directive("tgLeaveProject", ["$tgRepo", "$tgConfirm", "$tgLocation", "$tgResources", "$tgNavUrls", "$translate", "tgLightboxFactory", "tgCurrentUserService",
                                    LeaveProjectDirective])


