summaryrefslogtreecommitdiffstats
path: root/client/components/boards/boardArchive.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-08-23 11:09:48 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-08-26 19:59:44 +0200
commit48ac8b026ffdf8b3823c573e5693dcf1765383e2 (patch)
tree832576fddbcdef9810b206f1ee86469702497806 /client/components/boards/boardArchive.js
parent9faaf07e0257f622abcaa365408fa836a1cbdea8 (diff)
downloadwekan-48ac8b026ffdf8b3823c573e5693dcf1765383e2.tar.gz
wekan-48ac8b026ffdf8b3823c573e5693dcf1765383e2.tar.bz2
wekan-48ac8b026ffdf8b3823c573e5693dcf1765383e2.zip
Implement board archive and restoration
Diffstat (limited to 'client/components/boards/boardArchive.js')
-rw-r--r--client/components/boards/boardArchive.js35
1 files changed, 35 insertions, 0 deletions
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')