summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-04-16 16:38:20 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-08-10 23:57:35 +0200
commit64367a01dd6b86982c22b4c124e8f37474e9cb08 (patch)
tree8c8b5b9bf787cce7c7cc86db0480641722abfaba /models
parent5644ef66af2fb6e2bfb629a499bb21130bfd5c73 (diff)
downloadwekan-64367a01dd6b86982c22b4c124e8f37474e9cb08.tar.gz
wekan-64367a01dd6b86982c22b4c124e8f37474e9cb08.tar.bz2
wekan-64367a01dd6b86982c22b4c124e8f37474e9cb08.zip
Link description
Diffstat (limited to 'models')
-rw-r--r--models/cards.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js
index af8bea48..4b18b8f3 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -393,6 +393,39 @@ Cards.helpers({
isTopLevel() {
return this.parentId === '';
},
+
+ isImportedCard() {
+ return this.type === 'cardType-importedCard';
+ },
+
+ isImportedBoard() {
+ return this.type === 'cardType-importedBoard';
+ },
+
+ isImported() {
+ return this.isImportedCard() || this.isImportedBoard();
+ },
+
+ getDescription() {
+ if (this.isImportedCard()) {
+ const card = Cards.findOne({_id: this.importedId});
+ if (card && card.description)
+ return card.description;
+ else
+ return null;
+ } else if (this.isImportedBoard()) {
+ const board = Boards.findOne({_id: this.importedId});
+ if (board && board.description)
+ return board.description;
+ else
+ return null;
+ } else {
+ if (this.description)
+ return this.description;
+ else
+ return null;
+ }
+ },
});
Cards.mutations({