summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-04-21 00:14:10 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-08-11 00:15:51 +0200
commitbce22425280248eda01132ccc58c9f5beefb712a (patch)
tree32edb028b1c7f1de8ba7c87f3babc3c2860641f1 /models
parentf0597ef0c496352cb102d85227a46831a8b04c57 (diff)
downloadwekan-bce22425280248eda01132ccc58c9f5beefb712a.tar.gz
wekan-bce22425280248eda01132ccc58c9f5beefb712a.tar.bz2
wekan-bce22425280248eda01132ccc58c9f5beefb712a.zip
Add imported card location
Diffstat (limited to 'models')
-rw-r--r--models/cards.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js
index 987ce330..c6e80ea8 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -703,6 +703,20 @@ Cards.helpers({
}
},
+ getBoardTitle() {
+ if (this.isImportedCard()) {
+ const card = Cards.findOne({ _id: this.importedId });
+ const board = Boards.findOne({ _id: card.boardId });
+ return board.title;
+ } else if (this.isImportedBoard()) {
+ const board = Boards.findOne({ _id: this.importedId});
+ return board.title;
+ } else {
+ const board = Boards.findOne({ _id: this.boardId });
+ return board.title;
+ }
+ },
+
setTitle(title) {
if (this.isImportedCard()) {
return Cards.update(