From 6ff89b43b61ace7ea26d50f091ea6b714fa79c84 Mon Sep 17 00:00:00 2001 From: Pouyan Savoli Date: Tue, 5 Sep 2017 02:34:18 +0200 Subject: show custom fields on cards but still with dummy value --- models/cards.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'models/cards.js') 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', { -- cgit v1.2.3-1-g7c22