summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js
index 670a47cb..fe86e642 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -190,6 +190,27 @@ Cards.helpers({
return _.pluck(this.customFields, '_id').indexOf(customFieldId);
},
+ // customFields with definitions
+ customFieldsWD() {
+
+ // get all definitions
+ const definitions = CustomFields.find({
+ boardId: this.boardId,
+ }).fetch();
+
+ // match right definition to each field
+ return this.customFields.map((customField) => {
+ return {
+ _id: customField._id,
+ value: customField.value,
+ definition: definitions.find((definition) => {
+ return definition._id == customField._id;
+ })
+ }
+ });
+
+ },
+
absoluteUrl() {
const board = this.board();
return FlowRouter.url('card', {