Fixing history visualization in user story

stable
Alejandro Alonso 2014-07-10 19:04:57 +02:00
parent 43c17cea1b
commit 8c1c3a376d
1 changed files with 23 additions and 1 deletions

View File

@ -97,6 +97,28 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
.then(=> @.loadUs()) .then(=> @.loadUs())
.then(=> @.loadHistory()) .then(=> @.loadHistory())
getUserFullName: (userId) ->
return @scope.usersById[userId]?.full_name_display
getUserAvatar: (userId) ->
return @scope.usersById[userId]?.photo
countChanges: (comment) ->
return Object.keys(comment.values_diff).length
getChangeText: (change) ->
if _.isArray(change)
return change.join(", ")
return change
buildChangesText: (comment) ->
size = @.countChanges(comment)
#TODO: i18n
if size == 1
return "Made #{size} change"
return "Made #{size} changes"
module.controller("UserStoryDetailController", UserStoryDetailController) module.controller("UserStoryDetailController", UserStoryDetailController)