Merge branch 'ja-review-panel' of github.com:sharelatex/web-sharelatex into ja-review-panel

This commit is contained in:
Paulo Reis 2016-11-09 16:36:12 +00:00
commit f28119aacb
2 changed files with 8 additions and 3 deletions

View file

@ -65,8 +65,8 @@ div.full-size(
.review-entry-actions
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")

View file

@ -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?