diff --git a/client/components/cards/attachments.jade b/client/components/cards/attachments.jade index 61454fa79..f966ee89e 100644 --- a/client/components/cards/attachments.jade +++ b/client/components/cards/attachments.jade @@ -22,10 +22,10 @@ template(name="attachmentsGalery") .attachments-galery each attachments .attachment-item - a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}") + a.attachment-thumbnail.swipebox(href="{{link}}" title="{{name}}") if isUploaded if isImage - img.attachment-thumbnail-img(src="{{url}}") + img.attachment-thumbnail-img(src="{{link}}") else span.attachment-thumbnail-ext= extension else @@ -33,7 +33,7 @@ template(name="attachmentsGalery") p.attachment-details = name span.attachment-details-actions - a.js-download(href="{{url download=true}}") + a.js-download(href="{{link}}?download=true") i.fa.fa-download | {{_ 'download'}} if currentUser.isBoardMember diff --git a/models/cards.js b/models/cards.js index 378bb8f51..fe322c9fa 100644 --- a/models/cards.js +++ b/models/cards.js @@ -524,12 +524,12 @@ Cards.helpers({ return Attachments.find( { 'meta.cardId': this.linkedId }, { sort: { uploadedAt: -1 } }, - ); + ).each(); } else { return Attachments.find( { 'meta.cardId': this._id }, { sort: { uploadedAt: -1 } }, - ); + ).each(); } }, @@ -538,7 +538,7 @@ Cards.helpers({ const cover = Attachments.findOne(this.coverId); // if we return a cover before it is fully stored, we will get errors when we try to display it // todo XXX we could return a default "upload pending" image in the meantime? - return cover && cover.path && cover; + return cover && cover.link() && cover; }, checklists() {