diff --git a/app/scripts/files/files.controllers.ts b/app/scripts/files/files.controllers.ts index 3c92b2e46..4b606921b 100755 --- a/app/scripts/files/files.controllers.ts +++ b/app/scripts/files/files.controllers.ts @@ -40,10 +40,15 @@ module ngApp.files.controllers { this.archiveCount = 0; } - this.annotationIds = _.map(file.annotations, (annotation) => { - return annotation.annotation_id; - }); + _.every(file.associated_entities, (entity) => { + entity.annotations = _.find(file.annotations, (annotation) => { + return annotation.annotation_id === entity.entity_id; + }); + if (entity.annotations) { + entity.annotations = _.pluck(entity.annotations, "annotation_id"); + } + }); } isInCart(): boolean { diff --git a/app/scripts/files/module.ts b/app/scripts/files/module.ts index 6f05eb47f..a1dad33d0 100755 --- a/app/scripts/files/module.ts +++ b/app/scripts/files/module.ts @@ -36,6 +36,9 @@ module ngApp.files { "related_files.type", "related_files.file_name", "related_files.md5sum", + "associated_entities.entity_id", + "associated_entities.entity_type", + "associated_entities.participant_id", "annotations.annotation_id", "tags", "origin" diff --git a/app/scripts/files/templates/file.html b/app/scripts/files/templates/file.html index 5fba7e471..fea10d5f2 100755 --- a/app/scripts/files/templates/file.html +++ b/app/scripts/files/templates/file.html @@ -143,7 +143,7 @@
tbd | -tbd | +||
{{ ::e.entity_id }} | +{{ ::e.entity_type | humanify }} | - - {{ ::p.participant_id }} + + {{ ::e.participant_id }} | - {{ fc.file.annotations.length }} + {{ [{name: 'annotation_id', value: e.annotations }] | makeFilter }} })" + data-ng-if="e.annotations.length"> + {{ e.annotations.length }} + 0 |