mirror of
https://github.com/wekan/wekan.git
synced 2026-02-05 08:01:49 +01:00
merge with /devel
This commit is contained in:
commit
a7427b9ae4
27 changed files with 321 additions and 112 deletions
|
|
@ -1,4 +1,4 @@
|
|||
Attachments = new FS.Collection('attachments', {
|
||||
Attachments = new FS.Collection('attachments', { // eslint-disable-line meteor/collections
|
||||
stores: [
|
||||
|
||||
// XXX Add a new store for cover thumbnails so we don't load big images in
|
||||
|
|
|
|||
|
|
@ -97,11 +97,11 @@ Boards.helpers({
|
|||
},
|
||||
|
||||
labelIndex(labelId) {
|
||||
return _.indexOf(_.pluck(this.labels, '_id'), labelId);
|
||||
return _.pluck(this.labels, '_id').indexOf(labelId);
|
||||
},
|
||||
|
||||
memberIndex(memberId) {
|
||||
return _.indexOf(_.pluck(this.members, 'userId'), memberId);
|
||||
return _.pluck(this.members, 'userId').indexOf(memberId);
|
||||
},
|
||||
|
||||
absoluteUrl() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Users = Meteor.users;
|
||||
Users = Meteor.users; // eslint-disable-line meteor/collections
|
||||
|
||||
// Search a user in the complete server database by its name or username. This
|
||||
// is used for instance to add a new user to a board.
|
||||
|
|
@ -8,7 +8,23 @@ Users.initEasySearch(searchInFields, {
|
|||
returnFields: [...searchInFields, 'profile.avatarUrl'],
|
||||
});
|
||||
|
||||
if (Meteor.isClient) {
|
||||
Users.helpers({
|
||||
isBoardMember() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board &&
|
||||
_.contains(_.pluck(board.members, 'userId'), this._id) &&
|
||||
_.where(board.members, {userId: this._id})[0].isActive;
|
||||
},
|
||||
|
||||
isBoardAdmin() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board &&
|
||||
this.isBoardMember(board) &&
|
||||
_.where(board.members, {userId: this._id})[0].isAdmin;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Users.helpers({
|
||||
boards() {
|
||||
|
|
@ -25,18 +41,6 @@ Users.helpers({
|
|||
return _.contains(starredBoards, boardId);
|
||||
},
|
||||
|
||||
isBoardMember() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board && _.contains(_.pluck(board.members, 'userId'), this._id) &&
|
||||
_.where(board.members, {userId: this._id})[0].isActive;
|
||||
},
|
||||
|
||||
isBoardAdmin() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board && this.isBoardMember(board) &&
|
||||
_.where(board.members, {userId: this._id})[0].isAdmin;
|
||||
},
|
||||
|
||||
getAvatarUrl() {
|
||||
// Although we put the avatar picture URL in the `profile` object, we need
|
||||
// to support Sandstorm which put in the `picture` attribute by default.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue