mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 19:00:12 +01:00
Allow toogle of lists and swimlanes views
This commit is contained in:
parent
a14f4ffee2
commit
7b04f14e3c
7 changed files with 51 additions and 8 deletions
|
|
@ -20,5 +20,8 @@ template(name="boardBody")
|
||||||
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
|
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
|
||||||
if showOverlay.get
|
if showOverlay.get
|
||||||
.board-overlay
|
.board-overlay
|
||||||
|
if isViewSwimlanes
|
||||||
each currentBoard.swimlanes
|
each currentBoard.swimlanes
|
||||||
+swimlane(this)
|
+swimlane(this)
|
||||||
|
if isViewLists
|
||||||
|
+listsGroup
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,18 @@ BlazeComponent.extendComponent({
|
||||||
return Utils.isMiniScreen() && Session.get('currentCard');
|
return Utils.isMiniScreen() && Session.get('currentCard');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isViewSwimlanes() {
|
||||||
|
const currentBoardId = Session.get('currentBoard');
|
||||||
|
const board = Boards.findOne(currentBoardId);
|
||||||
|
return (board.view === 'board-view-swimlanes');
|
||||||
|
},
|
||||||
|
|
||||||
|
isViewLists() {
|
||||||
|
const currentBoardId = Session.get('currentBoard');
|
||||||
|
const board = Boards.findOne(currentBoardId);
|
||||||
|
return (board.view === 'board-view-lists');
|
||||||
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{
|
||||||
// XXX The board-overlay div should probably be moved to the parent
|
// XXX The board-overlay div should probably be moved to the parent
|
||||||
|
|
|
||||||
|
|
@ -82,13 +82,13 @@ BlazeComponent.extendComponent({
|
||||||
Boards.update(currentBoard._id, {
|
Boards.update(currentBoard._id, {
|
||||||
$set: {
|
$set: {
|
||||||
view: 'board-view-lists',
|
view: 'board-view-lists',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
} else if (currentBoard.view === 'board-view-lists') {
|
} else if (currentBoard.view === 'board-view-lists') {
|
||||||
Boards.update(currentBoard._id, {
|
Boards.update(currentBoard._id, {
|
||||||
$set: {
|
$set: {
|
||||||
view: 'board-view-swimlanes',
|
view: 'board-view-swimlanes',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ template(name="listBody")
|
||||||
if cards.count
|
if cards.count
|
||||||
+inlinedForm(autoclose=false position="top")
|
+inlinedForm(autoclose=false position="top")
|
||||||
+addCardForm(listId=_id position="top")
|
+addCardForm(listId=_id position="top")
|
||||||
each cards ../../_id
|
each (cards (idOrNull ../../_id))
|
||||||
a.minicard-wrapper.js-minicard(href=absoluteUrl
|
a.minicard-wrapper.js-minicard(href=absoluteUrl
|
||||||
class="{{#if cardIsSelected}}is-selected{{/if}}"
|
class="{{#if cardIsSelected}}is-selected{{/if}}"
|
||||||
class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
|
class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,13 @@ BlazeComponent.extendComponent({
|
||||||
MultiSelection.toggle(this.currentData()._id);
|
MultiSelection.toggle(this.currentData()._id);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
idOrNull(swimlaneId) {
|
||||||
|
const board = Boards.findOne(Session.get('currentBoard'));
|
||||||
|
if (board.view === 'board-view-swimlanes')
|
||||||
|
return swimlaneId;
|
||||||
|
return undefined;
|
||||||
|
},
|
||||||
|
|
||||||
canSeeAddCard() {
|
canSeeAddCard() {
|
||||||
return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,24 @@ template(name="swimlane")
|
||||||
+addListForm
|
+addListForm
|
||||||
+addListAndSwimlaneForm
|
+addListAndSwimlaneForm
|
||||||
|
|
||||||
|
template(name="listsGroup")
|
||||||
|
.swimlane.js-lists
|
||||||
|
if isMiniScreen
|
||||||
|
if currentList
|
||||||
|
+list(currentList)
|
||||||
|
else
|
||||||
|
each currentBoard.lists
|
||||||
|
+miniList(this)
|
||||||
|
if currentUser.isBoardMember
|
||||||
|
+addListForm
|
||||||
|
else
|
||||||
|
each currentBoard.lists
|
||||||
|
+list(this)
|
||||||
|
if currentCardIsInThisList
|
||||||
|
+cardDetails(currentCard)
|
||||||
|
if currentUser.isBoardMember
|
||||||
|
+addListForm
|
||||||
|
|
||||||
template(name="addListAndSwimlaneForm")
|
template(name="addListAndSwimlaneForm")
|
||||||
.list.js-list.list-composer.js-list-composer
|
.list.js-list.list-composer.js-list-composer
|
||||||
.list-header
|
.list-header
|
||||||
|
|
|
||||||
|
|
@ -76,11 +76,14 @@ Lists.allow({
|
||||||
|
|
||||||
Lists.helpers({
|
Lists.helpers({
|
||||||
cards(swimlaneId) {
|
cards(swimlaneId) {
|
||||||
return Cards.find(Filter.mongoSelector({
|
const selector = {
|
||||||
listId: this._id,
|
listId: this._id,
|
||||||
archived: false,
|
archived: false,
|
||||||
swimlaneId: swimlaneId,
|
};
|
||||||
}), { sort: ['sort'] });
|
if (swimlaneId)
|
||||||
|
selector.swimlaneId = swimlaneId;
|
||||||
|
return Cards.find(Filter.mongoSelector(selector,
|
||||||
|
{ sort: ['sort'] }));
|
||||||
},
|
},
|
||||||
|
|
||||||
allCards() {
|
allCards() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue