Merge pull request #199 from sharelatex/sk-missing-users

When a user is null in track-changes UI, display them as "Anonymous".
This commit is contained in:
Shane Kilkelly 2015-09-11 14:24:08 +01:00
commit 778f588741
2 changed files with 5 additions and 2 deletions

View file

@ -74,9 +74,11 @@ div#trackChanges(ng-show="ui.view == 'track-changes'")
span.doc {{ doc.entity.name }}
div.users
div.user(ng-repeat="update_user in update.meta.users")
.color-square(ng-style="{'background-color': 'hsl({{ update_user.hue }}, 70%, 50%)'}")
.color-square(ng-if="update_user != null", ng-style="{'background-color': 'hsl({{ update_user.hue }}, 70%, 50%)'}")
.color-square(ng-if="update_user == null", ng-style="{'background-color': 'hsl(100, 70%, 50%)'}")
.name(ng-if="update_user.id != user.id") {{update_user.first_name}} {{update_user.last_name}}
.name(ng-if="update_user.id == user.id") You
.name(ng-if="update_user == null") #{translate("anonymous")}
div.user(ng-if="update.meta.users.length == 0")
.color-square(style="background-color: hsl(100, 100%, 50%)")
span #{translate("anonymous")}

View file

@ -187,7 +187,8 @@ define [
doc.entity = @ide.fileTreeManager.findEntityById(doc_id, includeDeleted: true)
for user in update.meta.users or []
user.hue = @ide.onlineUsersManager.getHueForUserId(user.id)
if user?
user.hue = @ide.onlineUsersManager.getHueForUserId(user.id)
if !previousUpdate? or !moment(previousUpdate.meta.end_ts).isSame(update.meta.end_ts, "day")
update.meta.first_in_day = true