mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Allow card creation from template
This commit is contained in:
parent
0fec711545
commit
044126188d
1 changed files with 18 additions and 17 deletions
|
|
@ -593,26 +593,27 @@ BlazeComponent.extendComponent({
|
||||||
this.term.set(evt.target.searchTerm.value);
|
this.term.set(evt.target.searchTerm.value);
|
||||||
},
|
},
|
||||||
'click .js-minicard'(evt) {
|
'click .js-minicard'(evt) {
|
||||||
// LINK CARD
|
let card = Blaze.getData(evt.currentTarget);
|
||||||
const card = Blaze.getData(evt.currentTarget);
|
let _id = '';
|
||||||
const _id = Cards.insert({
|
// Common
|
||||||
title: card.title, //dummy
|
card.listId = this.listId;
|
||||||
listId: this.listId,
|
card.swimlaneId = this.swimlaneId;
|
||||||
swimlaneId: this.swimlaneId,
|
card.boardId = this.boardId;
|
||||||
boardId: this.boardId,
|
card.sort = Lists.findOne(this.listId).cards().count();
|
||||||
sort: Lists.findOne(this.listId).cards().count(),
|
// From template
|
||||||
type: 'cardType-linkedCard',
|
if (this.isTemplateSearch) {
|
||||||
linkedId: card.linkedId || card._id,
|
card.type = 'cardType-card';
|
||||||
});
|
card.linkedId = '';
|
||||||
|
_id = card.copy();
|
||||||
|
} else { // Linked
|
||||||
|
card._id = null;
|
||||||
|
card.type = 'cardType-linkedCard';
|
||||||
|
card.linkedId = card.linkedId || card._id;
|
||||||
|
_id = Cards.insert(card);
|
||||||
|
}
|
||||||
Filter.addException(_id);
|
Filter.addException(_id);
|
||||||
Popup.close();
|
Popup.close();
|
||||||
},
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
}).register('searchCardPopup');
|
}).register('searchCardPopup');
|
||||||
|
|
||||||
Template.searchCardPopup.helpers({
|
|
||||||
isTemplateSearch() {
|
|
||||||
return $(Popup._getTopStack().openerElement).hasClass('js-search-template');
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue