On history, use de default avatar for not-existing-users and using the name from the history
parent
89af22dbe5
commit
3e430e36ce
|
@ -282,7 +282,10 @@ HistoryDirective = ($log, $loading) ->
|
||||||
return $scope.usersById[userId]?.full_name_display
|
return $scope.usersById[userId]?.full_name_display
|
||||||
|
|
||||||
getUserAvatar = (userId) ->
|
getUserAvatar = (userId) ->
|
||||||
return $scope.usersById[userId]?.photo
|
if $scope.usersById[userId]?
|
||||||
|
return $scope.usersById[userId].photo
|
||||||
|
else
|
||||||
|
return "/images/unnamed.png"
|
||||||
|
|
||||||
countChanges = (comment) ->
|
countChanges = (comment) ->
|
||||||
return _.keys(comment.values_diff).length
|
return _.keys(comment.values_diff).length
|
||||||
|
@ -373,7 +376,7 @@ HistoryDirective = ($log, $loading) ->
|
||||||
|
|
||||||
return templateActivity({
|
return templateActivity({
|
||||||
avatar: getUserAvatar(comment.user.pk)
|
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")
|
creationDate: moment(comment.created_at).format("DD MMM YYYY HH:mm")
|
||||||
comment: comment.comment_html
|
comment: comment.comment_html
|
||||||
changesText: renderChangesHelperText(comment)
|
changesText: renderChangesHelperText(comment)
|
||||||
|
@ -388,7 +391,7 @@ HistoryDirective = ($log, $loading) ->
|
||||||
renderChange = (change) ->
|
renderChange = (change) ->
|
||||||
return templateActivity({
|
return templateActivity({
|
||||||
avatar: getUserAvatar(change.user.pk)
|
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")
|
creationDate: moment(change.created_at).format("DD MMM YYYY HH:mm")
|
||||||
comment: change.comment_html
|
comment: change.comment_html
|
||||||
changes: renderChangeEntries(change, false)
|
changes: renderChangeEntries(change, false)
|
||||||
|
|
Loading…
Reference in New Issue