Implement board archive and restoration

This commit is contained in:
Maxime Quandalle 2015-08-23 11:09:48 +02:00
parent 9faaf07e02
commit 48ac8b026f
32 changed files with 138 additions and 42 deletions

View file

@ -0,0 +1,35 @@
Template.headerTitle.events({
'click .js-open-archived-board': function() {
Modal.open('archivedBoards')
}
})
BlazeComponent.extendComponent({
template() {
return 'archivedBoards';
},
onCreated() {
this.subscribe('archivedBoards')
},
archivedBoards() {
return Boards.find({ archived: true }, {
sort: ['title']
})
},
events() {
return [{
'click .js-restore-board': function() {
let boardId = this.currentData()._id
Boards.update(boardId, {
$set: {
archived: false
}
})
Utils.goBoardId(boardId)
}
}]
},
}).register('archivedBoards')