On history, use de default avatar for not-existing-users and using the name from the history

stable
Jesús Espino 2014-10-17 12:56:48 +02:00
parent 89af22dbe5
commit 3e430e36ce
1 changed files with 6 additions and 3 deletions

View File

@ -282,7 +282,10 @@ HistoryDirective = ($log, $loading) ->
return $scope.usersById[userId]?.full_name_display
getUserAvatar = (userId) ->
return $scope.usersById[userId]?.photo
if $scope.usersById[userId]?
return $scope.usersById[userId].photo
else
return "/images/unnamed.png"
countChanges = (comment) ->
return _.keys(comment.values_diff).length
@ -373,7 +376,7 @@ HistoryDirective = ($log, $loading) ->
return templateActivity({
avatar: getUserAvatar(comment.user.pk)
userFullName: getUserFullName(comment.user.pk)
userFullName: comment.user.name
creationDate: moment(comment.created_at).format("DD MMM YYYY HH:mm")
comment: comment.comment_html
changesText: renderChangesHelperText(comment)
@ -388,7 +391,7 @@ HistoryDirective = ($log, $loading) ->
renderChange = (change) ->
return templateActivity({
avatar: getUserAvatar(change.user.pk)
userFullName: getUserFullName(change.user.pk)
userFullName: change.user.name
creationDate: moment(change.created_at).format("DD MMM YYYY HH:mm")
comment: change.comment_html
changes: renderChangeEntries(change, false)