Updating project list when saving project properties in admin

stable
Alejandro Alonso 2014-08-12 14:58:57 +02:00
parent ea1156af2d
commit dd74e8ca0a
2 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,7 @@ module.controller("ProjectProfileController", ProjectProfileController)
## Project Profile Directive ## Project Profile Directive
############################################################################# #############################################################################
ProjectProfileDirective = ($log, $repo, $confirm, $location) -> ProjectProfileDirective = ($log, $repo, $rootscope, $confirm, $location) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
form = $el.find("form").checksley({"onlyOneErrorElement": true}) form = $el.find("form").checksley({"onlyOneErrorElement": true})
submit = => submit = =>
@ -95,6 +95,7 @@ ProjectProfileDirective = ($log, $repo, $confirm, $location) ->
promise.then -> promise.then ->
$confirm.notify("success") $confirm.notify("success")
$location.path("/project/#{$scope.project.slug}/admin/project-profile/details") $location.path("/project/#{$scope.project.slug}/admin/project-profile/details")
$rootscope.$broadcast("projects:reload")
promise.then null, (data) -> promise.then null, (data) ->
form.setErrors(data) form.setErrors(data)
@ -153,5 +154,5 @@ ProjectFeaturesDirective = ($log, $repo, $confirm) ->
return {link:link} 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]) module.directive("tgProjectFeatures", ["$log", "$tgRepo", "$tgConfirm", ProjectFeaturesDirective])

View File

@ -37,6 +37,9 @@ class ProjectsNavigationController extends taiga.Controller
console.log "FAIL" console.log "FAIL"
# TODO # TODO
@scope.$on "projects:reload", =>
@.loadInitialData()
loadInitialData: -> loadInitialData: ->
return @rs.projects.list().then (projects) => return @rs.projects.list().then (projects) =>
for project in projects for project in projects