Updating project list when saving project properties in admin
parent
ea1156af2d
commit
dd74e8ca0a
|
@ -85,7 +85,7 @@ module.controller("ProjectProfileController", ProjectProfileController)
|
|||
## Project Profile Directive
|
||||
#############################################################################
|
||||
|
||||
ProjectProfileDirective = ($log, $repo, $confirm, $location) ->
|
||||
ProjectProfileDirective = ($log, $repo, $rootscope, $confirm, $location) ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
form = $el.find("form").checksley({"onlyOneErrorElement": true})
|
||||
submit = =>
|
||||
|
@ -95,6 +95,7 @@ ProjectProfileDirective = ($log, $repo, $confirm, $location) ->
|
|||
promise.then ->
|
||||
$confirm.notify("success")
|
||||
$location.path("/project/#{$scope.project.slug}/admin/project-profile/details")
|
||||
$rootscope.$broadcast("projects:reload")
|
||||
|
||||
promise.then null, (data) ->
|
||||
form.setErrors(data)
|
||||
|
@ -153,5 +154,5 @@ ProjectFeaturesDirective = ($log, $repo, $confirm) ->
|
|||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgProjectProfile", ["$log", "$tgRepo", "$tgConfirm", "$location", ProjectProfileDirective])
|
||||
module.directive("tgProjectProfile", ["$log", "$tgRepo", "$rootScope", "$tgConfirm", "$location", ProjectProfileDirective])
|
||||
module.directive("tgProjectFeatures", ["$log", "$tgRepo", "$tgConfirm", ProjectFeaturesDirective])
|
||||
|
|
|
@ -37,6 +37,9 @@ class ProjectsNavigationController extends taiga.Controller
|
|||
console.log "FAIL"
|
||||
# TODO
|
||||
|
||||
@scope.$on "projects:reload", =>
|
||||
@.loadInitialData()
|
||||
|
||||
loadInitialData: ->
|
||||
return @rs.projects.list().then (projects) =>
|
||||
for project in projects
|
||||
|
|
Loading…
Reference in New Issue