From 48ac8b026ffdf8b3823c573e5693dcf1765383e2 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Sun, 23 Aug 2015 11:09:48 +0200 Subject: Implement board archive and restoration --- client/components/boards/boardArchive.js | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 client/components/boards/boardArchive.js (limited to 'client/components/boards/boardArchive.js') diff --git a/client/components/boards/boardArchive.js b/client/components/boards/boardArchive.js new file mode 100644 index 00000000..1ce1a593 --- /dev/null +++ b/client/components/boards/boardArchive.js @@ -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') -- cgit v1.2.3-1-g7c22