mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
30 lines
675 B
JavaScript
30 lines
675 B
JavaScript
BlazeComponent.extendComponent({
|
|
template: function() {
|
|
return 'boardList';
|
|
},
|
|
|
|
boards: function() {
|
|
return Boards.find({
|
|
archived: false,
|
|
'members.userId': Meteor.userId()
|
|
}, {
|
|
sort: ['title']
|
|
});
|
|
},
|
|
|
|
isStarred: function() {
|
|
var user = Meteor.user();
|
|
return user && user.hasStarred(this.currentData()._id);
|
|
},
|
|
|
|
events: function() {
|
|
return [{
|
|
'click .js-add-board': Popup.open('createBoard'),
|
|
'click .js-star-board': function(evt) {
|
|
var boardId = this.currentData()._id;
|
|
Meteor.user().toggleBoardStar(boardId);
|
|
evt.preventDefault();
|
|
}
|
|
}];
|
|
}
|
|
}).register('boardList');
|