diff --git a/app/coffee/modules/common/history.coffee b/app/coffee/modules/common/history.coffee
index 5af10bcf..b64ffaf0 100644
--- a/app/coffee/modules/common/history.coffee
+++ b/app/coffee/modules/common/history.coffee
@@ -139,10 +139,12 @@ HistoryDirective = ($log) ->
<%= deleteComment %>
-
+ <% if (canRestoreComment) { %>
+
+ <% } %>
""")
@@ -172,7 +174,7 @@ HistoryDirective = ($log) ->
- <% if (!deleteCommentDate && mode !== "activity") { %>
+ <% if (!deleteCommentDate && mode !== "activity" && canDeleteComment) { %>
<% } %>
<% } %>
@@ -362,9 +364,10 @@ HistoryDirective = ($log) ->
if (comment.delete_comment_date or comment.delete_comment_user)
return templateDeletedComment({
deleteCommentDate: moment(comment.delete_comment_date).format("DD MMM YYYY HH:mm")
- deleteCommentUser: getUserFullName(comment.delete_comment_user)
+ deleteCommentUser: comment.delete_comment_user.name
deleteComment: comment.comment_html
activityId: comment.id
+ canRestoreComment: comment.delete_comment_user.pk == $scope.user.id or $scope.project.my_permissions.indexOf("modify_project") > -1
})
return templateActivity({
@@ -376,8 +379,9 @@ HistoryDirective = ($log) ->
changes: renderChangeEntries(comment, false)
mode: "comment"
deleteCommentDate: moment(comment.delete_comment_date).format("DD MMM YYYY HH:mm") if comment.delete_comment_date
- deleteCommentUser: getUserFullName(comment.delete_comment_user) if comment.delete_comment_user
+ deleteCommentUser: comment.delete_comment_user.name if comment.delete_comment_user?.name
activityId: comment.id
+ canDeleteComment: comment.user.pk == $scope.user.id or $scope.project.my_permissions.indexOf("modify_project") > -1
})
renderChange = (change) ->
@@ -390,7 +394,7 @@ HistoryDirective = ($log) ->
changesText: ""
mode: "activity"
deleteCommentDate: moment(change.delete_comment_date).format("DD MMM YYYY HH:mm") if change.delete_comment_date
- deleteCommentUser: getUserFullName(change.delete_comment_user) if change.delete_comment_user
+ deleteCommentUser: change.delete_comment_user.name if change.delete_comment_user?.name
activityId: change.id
})