mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
35 lines
765 B
JavaScript
35 lines
765 B
JavaScript
BlazeComponent.extendComponent({
|
|
template: function() {
|
|
return 'boardList';
|
|
},
|
|
|
|
boards: function() {
|
|
return Boards.find({}, {
|
|
sort: ['title']
|
|
});
|
|
},
|
|
|
|
starredBoards: function() {
|
|
var cursor = Boards.find({
|
|
_id: { $in: Meteor.user().profile.starredBoards || [] }
|
|
}, {
|
|
sort: ['title']
|
|
});
|
|
return cursor.count() === 0 ? null : cursor;
|
|
},
|
|
|
|
isStarred: function() {
|
|
var user = Meteor.user();
|
|
return user && user.hasStarred(this._id);
|
|
},
|
|
|
|
events: function() {
|
|
return [{
|
|
'click .js-add-board': Popup.open('createBoard'),
|
|
'click .js-star-board': function(evt) {
|
|
Meteor.user().toggleBoardStar(this._id);
|
|
evt.preventDefault();
|
|
}
|
|
}];
|
|
}
|
|
}).register('boardList');
|