mirror of
https://github.com/wekan/wekan.git
synced 2026-01-24 02:06:10 +01:00
Fixed Add member and @mentions.
Thanks to xet7 ! Fixes #6076, fixes #6077
This commit is contained in:
parent
603a65ef17
commit
ad511bd137
14 changed files with 413 additions and 149 deletions
|
|
@ -1,9 +1,12 @@
|
|||
template(name="userAvatar")
|
||||
a.member(class="js-{{#if assignee}}assignee{{else}}member{{/if}}" title="{{userData.profile.fullname}} ({{userData.username}}) {{_ memberType}}")
|
||||
if userData.profile.avatarUrl
|
||||
img.avatar.avatar-image(src="{{avatarUrl}}")
|
||||
a.member(class="js-{{#if assignee}}assignee{{else}}member{{/if}}" title="{{#if userData}}{{userData.profile.fullname}} ({{userData.username}}) {{_ memberType}}{{/if}}")
|
||||
if userData
|
||||
if userData.profile.avatarUrl
|
||||
img.avatar.avatar-image(src="{{avatarUrl}}")
|
||||
else
|
||||
+userAvatarInitials(userId=userData._id)
|
||||
else
|
||||
+userAvatarInitials(userId=userData._id)
|
||||
+userAvatarInitials(userId=this.userId)
|
||||
|
||||
if showStatus
|
||||
span.member-presence-status(class=presenceStatusClassName)
|
||||
|
|
|
|||
|
|
@ -7,12 +7,13 @@ import Team from '/models/team';
|
|||
|
||||
Template.userAvatar.helpers({
|
||||
userData() {
|
||||
return ReactiveCache.getUser(this.userId, {
|
||||
const user = ReactiveCache.getUser(this.userId, {
|
||||
fields: {
|
||||
profile: 1,
|
||||
username: 1,
|
||||
},
|
||||
});
|
||||
return user;
|
||||
},
|
||||
|
||||
avatarUrl() {
|
||||
|
|
@ -32,7 +33,21 @@ Template.userAvatar.helpers({
|
|||
|
||||
memberType() {
|
||||
const user = ReactiveCache.getUser(this.userId);
|
||||
return user && user.isBoardAdmin() ? 'admin' : 'normal';
|
||||
if (!user) return '';
|
||||
|
||||
const board = Utils.getCurrentBoard();
|
||||
if (!board) return '';
|
||||
|
||||
// Return role in priority order: Admin, Normal, NormalAssignedOnly, NoComments, CommentOnly, CommentAssignedOnly, Worker, ReadOnly, ReadAssignedOnly
|
||||
if (user.isBoardAdmin()) return 'admin';
|
||||
if (board.hasReadAssignedOnly(user._id)) return 'read-assigned-only';
|
||||
if (board.hasReadOnly(user._id)) return 'read-only';
|
||||
if (board.hasWorker(user._id)) return 'worker';
|
||||
if (board.hasCommentAssignedOnly(user._id)) return 'comment-assigned-only';
|
||||
if (board.hasCommentOnly(user._id)) return 'comment-only';
|
||||
if (board.hasNoComments(user._id)) return 'no-comments';
|
||||
if (board.hasNormalAssignedOnly(user._id)) return 'normal-assigned-only';
|
||||
return 'normal';
|
||||
},
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue