diff options
Diffstat (limited to 'client/components/boards')
-rw-r--r-- | client/components/boards/boardArchive.jade | 16 | ||||
-rw-r--r-- | client/components/boards/boardArchive.js | 12 | ||||
-rw-r--r-- | client/components/boards/boardHeader.js | 6 |
3 files changed, 30 insertions, 4 deletions
diff --git a/client/components/boards/boardArchive.jade b/client/components/boards/boardArchive.jade index 6576f742..5d291f00 100644 --- a/client/components/boards/boardArchive.jade +++ b/client/components/boards/boardArchive.jade @@ -6,9 +6,17 @@ template(name="archivedBoards") ul.archived-lists each archivedBoards li.archived-lists-item - button.js-restore-board - i.fa.fa-undo - | {{_ 'restore-board'}} - = title + div.board-header-btns + button.board-header-btn.js-delete-board + i.fa.fa-trash-o + | {{_ 'delete-board'}} + button.board-header-btn.js-restore-board + i.fa.fa-undo + | {{_ 'restore-board'}} + = title else li.no-items-message {{_ 'no-archived-boards'}} + +template(name="boardDeletePopup") + p {{_ 'delete-board-confirm-popup'}} + button.js-confirm.negate.full(type="submit") {{_ 'delete'}} diff --git a/client/components/boards/boardArchive.js b/client/components/boards/boardArchive.js index acb53149..dbebdd70 100644 --- a/client/components/boards/boardArchive.js +++ b/client/components/boards/boardArchive.js @@ -29,6 +29,18 @@ BlazeComponent.extendComponent({ board.restore(); Utils.goBoardId(board._id); }, + 'click .js-delete-board': Popup.afterConfirm('boardDelete', function() { + Popup.close(); + const isSandstorm = Meteor.settings && Meteor.settings.public && + Meteor.settings.public.sandstorm; + if (isSandstorm && Session.get('currentBoard')) { + const currentBoard = Boards.findOne(Session.get('currentBoard')); + Boards.remove(currentBoard._id); + } + const board = this.currentData(); + Boards.remove(board._id); + FlowRouter.go('home'); + }), }]; }, }).register('archivedBoards'); diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index e0b19246..b2640474 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -17,6 +17,12 @@ Template.boardMenuPopup.events({ // confirm that the board was successfully archived. FlowRouter.go('home'); }), + 'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() { + const currentBoard = Boards.findOne(Session.get('currentBoard')); + Popup.close(); + Boards.remove(currentBoard._id); + FlowRouter.go('home'); + }), 'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'), 'click .js-import-board': Popup.open('chooseBoardSource'), }); |