summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorPouyan Savoli <papoola@hotmail.com>2017-09-05 02:34:18 +0200
committerPouyan Savoli <papoola@hotmail.com>2017-09-22 22:59:32 +0200
commit6ff89b43b61ace7ea26d50f091ea6b714fa79c84 (patch)
tree362c1bc771df9d20ab756cd4d8f26cf9f2d10246 /models
parent733b14dcd8f4b94047ffd444e7ab7ded49c245c0 (diff)
downloadwekan-6ff89b43b61ace7ea26d50f091ea6b714fa79c84.tar.gz
wekan-6ff89b43b61ace7ea26d50f091ea6b714fa79c84.tar.bz2
wekan-6ff89b43b61ace7ea26d50f091ea6b714fa79c84.zip
show custom fields on cards but still with dummy value
Diffstat (limited to 'models')
-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', {