mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 16:33:15 +00:00
Show user name in comments
This commit is contained in:
parent
b44f1cde10
commit
184b421b1f
2 changed files with 8 additions and 3 deletions
|
@ -62,8 +62,8 @@ div.full-size(
|
|||
| {{ entry.content }}
|
||||
div(ng-if="entry.type == 'comment'")
|
||||
div(ng-repeat="comment in entry.thread", class="comment-thread__comment")
|
||||
div.small(style="color: hsl({{ users[comment.user_id].hue }}, 70%, 50%)") {{ users[comment.user_id].name }}
|
||||
div.small {{ comment.ts }}
|
||||
div.small {{ comment.user_id }}
|
||||
| {{ comment.content }}
|
||||
div(ng-if="entry.replying")
|
||||
textarea(ng-model="entry.replyContent")
|
||||
|
|
|
@ -95,16 +95,21 @@ define [
|
|||
entry.replyContent = ""
|
||||
$scope.$broadcast "review-panel:layout"
|
||||
|
||||
# TODO: Eventually we need to get this from the server, and update it
|
||||
# when we get an id we don't know. This'll do for client side testing
|
||||
refreshUsers = () ->
|
||||
$scope.users = {}
|
||||
for member in $scope.project.members.concat($scope.project.owner)
|
||||
if member._id == window.user_id
|
||||
name = "You"
|
||||
else
|
||||
name = "#{member.first_name} #{member.last_name}"
|
||||
$scope.users[member._id] = {
|
||||
email: member.email
|
||||
name: "#{member.first_name} #{member.last_name}"
|
||||
name: name
|
||||
hue: ColorManager.getHueForUserId(member._id)
|
||||
avatar_text: [member.first_name, member.last_name].filter((n) -> n?).map((n) -> n[0]).join ""
|
||||
}
|
||||
console.log "REFRESHED USERS", $scope.project.members, $scope.users
|
||||
|
||||
$scope.$watch "project.members", (members) ->
|
||||
return if !members?
|
||||
|
|
Loading…
Reference in a new issue