summaryrefslogtreecommitdiffstats
path: root/client/components/boards/boardArchive.js
blob: 1ce1a593525a4dc953f2657c082b8f97e69df483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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')