2015-06-07 18:55:26 +02:00
|
|
|
BlazeComponent.extendComponent({
|
2015-09-03 23:12:46 +02:00
|
|
|
tabs() {
|
2015-08-22 02:06:49 +02:00
|
|
|
return [
|
2015-09-01 14:38:07 +02:00
|
|
|
{ name: TAPi18n.__('cards'), slug: 'cards' },
|
2015-09-03 23:12:46 +02:00
|
|
|
{ name: TAPi18n.__('lists'), slug: 'lists' },
|
|
|
|
|
];
|
2015-08-22 02:06:49 +02:00
|
|
|
},
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
archivedCards() {
|
2015-09-24 04:10:27 +02:00
|
|
|
return Cards.find({
|
|
|
|
|
archived: true,
|
|
|
|
|
boardId: Session.get('currentBoard'),
|
|
|
|
|
});
|
2015-08-22 02:06:49 +02:00
|
|
|
},
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
archivedLists() {
|
2015-09-24 04:10:27 +02:00
|
|
|
return Lists.find({
|
|
|
|
|
archived: true,
|
|
|
|
|
boardId: Session.get('currentBoard'),
|
|
|
|
|
});
|
2015-06-07 18:55:26 +02:00
|
|
|
},
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
cardIsInArchivedList() {
|
2015-08-20 23:48:34 +02:00
|
|
|
return this.currentData().list().archived;
|
|
|
|
|
},
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
onRendered() {
|
|
|
|
|
// XXX We should support dragging a card from the sidebar to the board
|
2015-06-07 18:55:26 +02:00
|
|
|
},
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
events() {
|
2015-06-07 18:55:26 +02:00
|
|
|
return [{
|
2015-09-03 23:12:46 +02:00
|
|
|
'click .js-restore-card'() {
|
2015-09-08 20:19:42 +02:00
|
|
|
const card = this.currentData();
|
2017-10-04 17:48:37 +02:00
|
|
|
if(card.canBeRestored()){
|
|
|
|
|
card.restore();
|
|
|
|
|
}
|
2015-06-07 18:55:26 +02:00
|
|
|
},
|
2015-08-22 02:06:49 +02:00
|
|
|
'click .js-delete-card': Popup.afterConfirm('cardDelete', function() {
|
2015-09-03 23:12:46 +02:00
|
|
|
const cardId = this._id;
|
2015-06-07 18:55:26 +02:00
|
|
|
Cards.remove(cardId);
|
|
|
|
|
Popup.close();
|
2015-08-22 02:06:49 +02:00
|
|
|
}),
|
2015-09-03 23:12:46 +02:00
|
|
|
'click .js-restore-list'() {
|
2015-09-08 20:19:42 +02:00
|
|
|
const list = this.currentData();
|
|
|
|
|
list.restore();
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
2015-06-07 18:55:26 +02:00
|
|
|
}];
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
2015-06-07 18:55:26 +02:00
|
|
|
}).register('archivesSidebar');
|