summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-01-22 16:54:19 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-01-22 16:54:19 -0300
commita14f4ffee297872c72edc99d7b147d18802f7d44 (patch)
tree02376dced6aa57a3b7e0bf5a78a34582c38d04b8 /client
parent2d7d9b5d9ffed0349b2cf65acc61561c21d05aaf (diff)
downloadwekan-a14f4ffee297872c72edc99d7b147d18802f7d44.tar.gz
wekan-a14f4ffee297872c72edc99d7b147d18802f7d44.tar.bz2
wekan-a14f4ffee297872c72edc99d7b147d18802f7d44.zip
Add view boards field to change between views
Diffstat (limited to 'client')
-rw-r--r--client/components/boards/boardHeader.jade5
-rw-r--r--client/components/boards/boardHeader.js16
2 files changed, 21 insertions, 0 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade
index ffb8eb27..1a65ce27 100644
--- a/client/components/boards/boardHeader.jade
+++ b/client/components/boards/boardHeader.jade
@@ -87,6 +87,11 @@ template(name="boardHeaderBar")
a.board-header-btn-close.js-filter-reset(title="{{_ 'filter-clear'}}")
i.fa.fa-times-thin
+ a.board-header-btn.js-toggle-board-view(
+ title="{{_ 'board-view'}}")
+ i.fa.fa-th-large
+ span {{_ currentBoard.view}}
+
if canModifyBoard
a.board-header-btn.js-multiselection-activate(
title="{{#if MultiSelection.isActive}}{{_ 'multi-selection-on'}}{{else}}{{_ 'multi-selection'}}{{/if}}"
diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js
index e6943b40..4cc582b1 100644
--- a/client/components/boards/boardHeader.js
+++ b/client/components/boards/boardHeader.js
@@ -76,6 +76,22 @@ BlazeComponent.extendComponent({
'click .js-open-archived-board'() {
Modal.open('archivedBoards');
},
+ 'click .js-toggle-board-view'() {
+ const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ if (currentBoard.view === 'board-view-swimlanes') {
+ Boards.update(currentBoard._id, {
+ $set: {
+ view: 'board-view-lists',
+ }
+ });
+ } else if (currentBoard.view === 'board-view-lists') {
+ Boards.update(currentBoard._id, {
+ $set: {
+ view: 'board-view-swimlanes',
+ }
+ });
+ }
+ },
'click .js-open-filter-view'() {
Sidebar.setView('filter');
},