mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
Allow list creation from template
This commit is contained in:
parent
044126188d
commit
f888cfd565
8 changed files with 121 additions and 26 deletions
|
|
@ -137,6 +137,24 @@ Lists.allow({
|
|||
});
|
||||
|
||||
Lists.helpers({
|
||||
copy() {
|
||||
const oldId = this._id;
|
||||
this._id = null;
|
||||
const _id = Lists.insert(this);
|
||||
|
||||
// Copy all cards in list
|
||||
Cards.find({
|
||||
listId: oldId,
|
||||
archived: false,
|
||||
}).forEach((card) => {
|
||||
card.type = 'cardType-card';
|
||||
card.listId = _id;
|
||||
card.boardId = this.boardId;
|
||||
card.swimlaneId = this.swimlaneId;
|
||||
card.copy();
|
||||
});
|
||||
},
|
||||
|
||||
cards(swimlaneId) {
|
||||
const selector = {
|
||||
listId: this._id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue