Procházet zdrojové kódy

fix: thumbnail images now wrok

David Arnold před 4 roky
rodič
revize
f847439e10
2 změnil soubory, kde provedl 11 přidání a 11 odebrání
  1. 8 8
      client/components/cards/attachments.jade
  2. 3 3
      models/cards.js

+ 8 - 8
client/components/cards/attachments.jade

@@ -12,7 +12,7 @@ template(name="previewClipboardImagePopup")
   button.primary.js-upload-pasted-image {{_ 'upload'}}
   button.primary.js-upload-pasted-image {{_ 'upload'}}
 
 
 template(name="previewAttachedImagePopup")
 template(name="previewAttachedImagePopup")
-  img.preview-large-image.js-large-image-clicked(src="{{url}}")
+  img.preview-large-image.js-large-image-clicked(src="{{link}}")
 
 
 template(name="attachmentDeletePopup")
 template(name="attachmentDeletePopup")
   p {{_ "attachment-delete-pop"}}
   p {{_ "attachment-delete-pop"}}
@@ -22,22 +22,22 @@ template(name="attachmentsGalery")
   .attachments-galery
   .attachments-galery
     each attachments
     each attachments
       .attachment-item
       .attachment-item
-        a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}")
+        a.attachment-thumbnail.swipebox(href="{{link}}" title="{{name}}")
           if isUploaded
           if isUploaded
             if isImage
             if isImage
-              img.attachment-thumbnail-img(src="{{url}}")
+              img.attachment-thumbnail-img(src="{{link}}")
             else if($eq extension 'mp3')
             else if($eq extension 'mp3')
                 video(width="100%" height="100%" controls="true")
                 video(width="100%" height="100%" controls="true")
-                  source(src="{{url}}" type="audio/mpeg")
+                  source(src="{{link}}" type="audio/mpeg")
             else if($eq extension 'ogg')
             else if($eq extension 'ogg')
                 video(width="100%" height="100%" controls="true")
                 video(width="100%" height="100%" controls="true")
-                  source(src="{{url}}" type="video/ogg")
+                  source(src="{{link}}" type="video/ogg")
             else if($eq extension 'webm')
             else if($eq extension 'webm')
                 video(width="100%" height="100%" controls="true")
                 video(width="100%" height="100%" controls="true")
-                  source(src="{{url}}" type="video/webm")
+                  source(src="{{link}}" type="video/webm")
             else if($eq extension 'mp4')
             else if($eq extension 'mp4')
                 video(width="100%" height="100%" controls="true")
                 video(width="100%" height="100%" controls="true")
-                  source(src="{{url}}" type="video/mp4")
+                  source(src="{{link}}" type="video/mp4")
             else
             else
               span.attachment-thumbnail-ext= extension
               span.attachment-thumbnail-ext= extension
           else
           else
@@ -46,7 +46,7 @@ template(name="attachmentsGalery")
           = name
           = name
           span.file-size ({{fileSize size}} KB)
           span.file-size ({{fileSize size}} KB)
           span.attachment-details-actions
           span.attachment-details-actions
-            a.js-download(href="{{url download=true}}")
+            a.js-download(href="{{link}}?download=true")
               i.fa.fa-download
               i.fa.fa-download
               | {{_ 'download'}}
               | {{_ 'download'}}
             if currentUser.isBoardMember
             if currentUser.isBoardMember

+ 3 - 3
models/cards.js

@@ -740,12 +740,12 @@ Cards.helpers({
       return Attachments.find(
       return Attachments.find(
         { 'meta.cardId': this.linkedId },
         { 'meta.cardId': this.linkedId },
         { sort: { uploadedAt: -1 } },
         { sort: { uploadedAt: -1 } },
-      );
+      ).each();
     } else {
     } else {
       return Attachments.find(
       return Attachments.find(
         { 'meta.cardId': this._id },
         { 'meta.cardId': this._id },
         { sort: { uploadedAt: -1 } },
         { sort: { uploadedAt: -1 } },
-      );
+      ).each();
     }
     }
   },
   },
 
 
@@ -754,7 +754,7 @@ Cards.helpers({
     const cover = Attachments.findOne(this.coverId);
     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
     // 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?
     // todo XXX we could return a default "upload pending" image in the meantime?
-    return cover && cover.path && cover;
+    return cover && cover.link() && cover;
   },
   },
 
 
   checklists() {
   checklists() {