mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Fix miniscreen render
This commit is contained in:
parent
eb62c9ce6a
commit
775476f97c
5 changed files with 24 additions and 21 deletions
|
|
@ -630,8 +630,8 @@ BlazeComponent.extendComponent({
|
||||||
} else if (this.isListTemplateSearch) {
|
} else if (this.isListTemplateSearch) {
|
||||||
element.sort = Swimlanes.findOne(this.swimlaneId).lists().count();
|
element.sort = Swimlanes.findOne(this.swimlaneId).lists().count();
|
||||||
element.type = 'list';
|
element.type = 'list';
|
||||||
element.swimlaneId = this.swimlaneId;
|
element.swimlaneId = '';
|
||||||
_id = element.copy();
|
_id = element.copy(this.swimlaneId);
|
||||||
} else if (this.isSwimlaneTemplateSearch) {
|
} else if (this.isSwimlaneTemplateSearch) {
|
||||||
element.sort = Boards.findOne(this.boardId).swimlanes().count();
|
element.sort = Boards.findOne(this.boardId).swimlanes().count();
|
||||||
element.type = 'swimlalne';
|
element.type = 'swimlalne';
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,15 @@ template(name="swimlane")
|
||||||
+swimlaneHeader
|
+swimlaneHeader
|
||||||
.swimlane.js-lists.js-swimlane
|
.swimlane.js-lists.js-swimlane
|
||||||
if isMiniScreen
|
if isMiniScreen
|
||||||
if currentList
|
if currentListIsInThisSwimlane _id
|
||||||
+list(currentList)
|
+list(currentList)
|
||||||
else
|
unless currentList
|
||||||
each currentBoard.lists
|
each lists
|
||||||
+miniList(this)
|
+miniList(this)
|
||||||
if currentUser.isBoardMember
|
if currentUser.isBoardMember
|
||||||
+addListForm
|
+addListForm
|
||||||
else if currentBoard.isTemplatesBoard
|
|
||||||
each lists
|
|
||||||
+list(this)
|
|
||||||
if currentCardIsInThisList _id ../_id
|
|
||||||
+cardDetails(currentCard)
|
|
||||||
if currentUser.isBoardMember
|
|
||||||
+addListForm
|
|
||||||
else
|
else
|
||||||
each currentBoard.lists
|
each lists
|
||||||
+list(this)
|
+list(this)
|
||||||
if currentCardIsInThisList _id ../_id
|
if currentCardIsInThisList _id ../_id
|
||||||
+cardDetails(currentCard)
|
+cardDetails(currentCard)
|
||||||
|
|
@ -31,12 +24,12 @@ template(name="listsGroup")
|
||||||
if currentList
|
if currentList
|
||||||
+list(currentList)
|
+list(currentList)
|
||||||
else
|
else
|
||||||
each currentBoard.lists
|
each lists
|
||||||
+miniList(this)
|
+miniList(this)
|
||||||
if currentUser.isBoardMember
|
if currentUser.isBoardMember
|
||||||
+addListForm
|
+addListForm
|
||||||
else
|
else
|
||||||
each currentBoard.lists
|
each lists
|
||||||
+list(this)
|
+list(this)
|
||||||
if currentCardIsInThisList _id null
|
if currentCardIsInThisList _id null
|
||||||
+cardDetails(currentCard)
|
+cardDetails(currentCard)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
const { calculateIndex, enableClickOnTouch } = Utils;
|
const { calculateIndex, enableClickOnTouch } = Utils;
|
||||||
|
|
||||||
|
function currentListIsInThisSwimlane(swimlaneId) {
|
||||||
|
const currentList = Lists.findOne(Session.get('currentList'));
|
||||||
|
return currentList && (currentList.swimlaneId === swimlaneId || currentList.swimlaneId === '');
|
||||||
|
}
|
||||||
|
|
||||||
function currentCardIsInThisList(listId, swimlaneId) {
|
function currentCardIsInThisList(listId, swimlaneId) {
|
||||||
const currentCard = Cards.findOne(Session.get('currentCard'));
|
const currentCard = Cards.findOne(Session.get('currentCard'));
|
||||||
const currentUser = Meteor.user();
|
const currentUser = Meteor.user();
|
||||||
|
|
@ -114,6 +119,10 @@ BlazeComponent.extendComponent({
|
||||||
return currentCardIsInThisList(listId, swimlaneId);
|
return currentCardIsInThisList(listId, swimlaneId);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
currentListIsInThisSwimlane(swimlaneId) {
|
||||||
|
return currentListIsInThisSwimlane(swimlaneId);
|
||||||
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{
|
||||||
// Click-and-drag action
|
// Click-and-drag action
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Lists.attachSchema(new SimpleSchema({
|
||||||
},
|
},
|
||||||
swimlaneId: {
|
swimlaneId: {
|
||||||
/**
|
/**
|
||||||
* the swimalen associated to this list. Used for templates
|
* the swimlane associated to this list. Used for templates
|
||||||
*/
|
*/
|
||||||
type: String,
|
type: String,
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
|
|
@ -137,7 +137,7 @@ Lists.allow({
|
||||||
});
|
});
|
||||||
|
|
||||||
Lists.helpers({
|
Lists.helpers({
|
||||||
copy() {
|
copy(swimlaneId) {
|
||||||
const oldId = this._id;
|
const oldId = this._id;
|
||||||
let _id = null;
|
let _id = null;
|
||||||
existingListWithSameName = Lists.findOne({
|
existingListWithSameName = Lists.findOne({
|
||||||
|
|
@ -159,7 +159,7 @@ Lists.helpers({
|
||||||
card.type = 'cardType-card';
|
card.type = 'cardType-card';
|
||||||
card.listId = _id;
|
card.listId = _id;
|
||||||
card.boardId = this.boardId;
|
card.boardId = this.boardId;
|
||||||
card.swimlaneId = this.swimlaneId;
|
card.swimlaneId = swimlaneId;
|
||||||
card.copy();
|
card.copy();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,9 @@ Swimlanes.helpers({
|
||||||
archived: false,
|
archived: false,
|
||||||
}).forEach((list) => {
|
}).forEach((list) => {
|
||||||
list.type = 'list';
|
list.type = 'list';
|
||||||
list.swimlaneId = _id;
|
list.swimlaneId = '';
|
||||||
list.boardId = this.boardId;
|
list.boardId = this.boardId;
|
||||||
list.copy();
|
list.copy(_id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -127,7 +127,8 @@ Swimlanes.helpers({
|
||||||
|
|
||||||
lists() {
|
lists() {
|
||||||
return Lists.find(Filter.mongoSelector({
|
return Lists.find(Filter.mongoSelector({
|
||||||
swimlaneId: this._id,
|
boardId: this.boardId,
|
||||||
|
swimlaneId: {$in: [this._id, '']},
|
||||||
archived: false,
|
archived: false,
|
||||||
}), { sort: ['sort'] });
|
}), { sort: ['sort'] });
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue