issue 2855 fix the save the project description when the project has tags

stable
Juanfran 2015-06-16 11:23:10 +02:00
parent 0afb804a61
commit eb1e9e1ea2
2 changed files with 6 additions and 7 deletions

View File

@ -90,13 +90,8 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.$emit('project:loaded', project)
return project
loadTagsColors: ->
return @rs.projects.tagsColors(@scope.projectId).then (tags_colors) =>
@scope.project.tags_colors = tags_colors
loadInitialData: ->
promise = @.loadProject()
promise.then => @.loadTagsColors()
return promise
openDeleteLightbox: ->
@ -111,6 +106,8 @@ module.controller("ProjectProfileController", ProjectProfileController)
ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, projectService) ->
link = ($scope, $el, $attrs) ->
$ctrl = $el.controller()
form = $el.find("form").checksley({"onlyOneErrorElement": true})
submit = debounce 2000, (event) =>
event.preventDefault()
@ -118,6 +115,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, proje
return if not form.validate()
$loading.start(submitButton)
promise = $repo.save($scope.project)
promise.then ->
$loading.finish(submitButton)
@ -126,7 +124,8 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, proje
project: $scope.project.slug
})
$location.path(newUrl)
$scope.$emit("project:loaded", $scope.project)
$ctrl.loadInitialData()
projectService.fetchProject()

View File

@ -38,7 +38,7 @@ div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl"
fieldset
label(for="tags", translate="ADMIN.PROJECT_PROFILE.TAGS")
div.tags-block(tg-lb-tag-line, ng-model="project.tags")
div.tags-block(ng-if="project.id", tg-lb-tag-line, ng-model="project.tags")
fieldset
label(for="project-description", translate="ADMIN.PROJECT_PROFILE.DESCRIPTION")