summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/components/boards/boardHeader.jade5
-rw-r--r--client/components/boards/boardHeader.js16
-rw-r--r--i18n/en.i18n.json3
-rw-r--r--models/boards.js8
-rw-r--r--server/migrations.js12
5 files changed, 44 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');
},
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index be04fac0..acb7992f 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -95,6 +95,9 @@
"boardChangeWatchPopup-title": "Change Watch",
"boardMenuPopup-title": "Board Menu",
"boards": "Boards",
+ "board-view": "Board View",
+ "board-view-swimlanes": "Swimlanes",
+ "board-view-lists": "Lists",
"bucket-example": "Like “Bucket List” for example",
"cancel": "Cancel",
"card-archived": "This card is archived.",
diff --git a/models/boards.js b/models/boards.js
index 5f39d8a4..84a715fb 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -31,6 +31,14 @@ Boards.attachSchema(new SimpleSchema({
}
},
},
+ view: {
+ type: String,
+ autoValue() { // eslint-disable-line consistent-return
+ if (this.isInsert) {
+ return 'board-view-swimlanes';
+ }
+ },
+ },
createdAt: {
type: Date,
autoValue() { // eslint-disable-line consistent-return
diff --git a/server/migrations.js b/server/migrations.js
index fbb33636..f2cb124b 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -175,3 +175,15 @@ Migrations.add('add-swimlanes', () => {
});
});
});
+
+Migrations.add('add-views', () => {
+ Boards.find().forEach((board) => {
+ if (!board.hasOwnProperty('view')) {
+ Boards.direct.update(
+ { _id: board._id },
+ { $set: { view: 'board-view-swimlanes' } },
+ noValidate
+ );
+ }
+ });
+});