diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-06-07 22:53:06 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-06-07 22:53:06 +0300 |
commit | b3bb03fed4c4ddef4492c40d79f7dc313b48c201 (patch) | |
tree | f72743a33a734822c97f4fdbacdcad644cae5771 /client/components/boards | |
parent | 123d9659c155b649e8aa112e474760d3fe3b7301 (diff) | |
parent | 1332a578901ae131f7a2a8fffd566072e5440e46 (diff) | |
download | wekan-b3bb03fed4c4ddef4492c40d79f7dc313b48c201.tar.gz wekan-b3bb03fed4c4ddef4492c40d79f7dc313b48c201.tar.bz2 wekan-b3bb03fed4c4ddef4492c40d79f7dc313b48c201.zip |
Merge branch 'moreFieldsColours' of https://github.com/rjevnikar/wekan into rjevnikar-moreFieldsColours
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..3008822c 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-restore-board + i.fa.fa-undo + | {{_ 'restore-board'}} + button.board-header-btn.js-delete-board + i.fa.fa-trash-o + | {{_ 'delete-board'}} + = title else li.no-items-message {{_ 'no-archived-boards'}} + +template(name="boardDeletePopup") + p {{_ 'delete-board-pop'}} + 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'), }); |