mirror of
https://github.com/wekan/wekan.git
synced 2026-01-24 02:06:10 +01:00
Implement presence indicators
This commit is contained in:
parent
6db01bb3c7
commit
f4c80d1315
18 changed files with 116 additions and 228 deletions
22
client/components/users/userAvatar.js
Normal file
22
client/components/users/userAvatar.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Template.userAvatar.helpers({
|
||||
userData: function() {
|
||||
if (! this.user) {
|
||||
this.user = Users.findOne(this.userId);
|
||||
}
|
||||
return this.user;
|
||||
},
|
||||
memberType: function() {
|
||||
var userId = this.userId || this.user._id;
|
||||
var user = Users.findOne(userId);
|
||||
return user && user.isBoardAdmin() ? 'admin' : 'normal';
|
||||
},
|
||||
presenceStatusClassName: function() {
|
||||
var userPresence = Presences.findOne({ userId: this.user._id });
|
||||
if (! userPresence)
|
||||
return 'disconnected';
|
||||
else if (Session.equals('currentBoard', userPresence.state.currentBoardId))
|
||||
return 'active';
|
||||
else
|
||||
return 'idle';
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue