attachments.jade 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. template(name="cardAttachmentsPopup")
  2. if $gt uploads.length 0
  3. .attachment-upload {{_ 'uploading'}}
  4. table
  5. tr
  6. th.upload-file-name-descr {{_ 'name'}}
  7. th.upload-progress-descr {{_ 'progress'}}
  8. th.upload-remaining-descr {{_ 'remaining_time'}}
  9. th.upload-speed-descr {{_ 'speed'}}
  10. each upload in uploads
  11. tr
  12. td.upload-file-name-value {{upload.file.name}}
  13. td.upload-progress-value {{upload.progress.get}}%
  14. td.upload-remaining-value {{getEstimateTime upload}}
  15. td.upload-speed-value {{getEstimateSpeed upload}}
  16. else
  17. ul.pop-over-list
  18. li
  19. input.js-attach-file.hide(type="file" name="file" multiple)
  20. a.js-computer-upload {{_ 'computer'}}
  21. li
  22. a.js-upload-clipboard-image {{_ 'clipboard'}}
  23. template(name="previewClipboardImagePopup")
  24. p <kbd>Ctrl</kbd>+<kbd>V</kbd> {{_ "paste-or-dragdrop"}}
  25. img.preview-clipboard-image()
  26. button.primary.js-upload-pasted-image {{_ 'upload'}}
  27. template(name="attachmentDeletePopup")
  28. p {{_ "attachment-delete-pop"}}
  29. button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
  30. template(name="attachmentViewer")
  31. #viewer-overlay.hidden
  32. #viewer-top-bar
  33. span#attachment-name
  34. a#viewer-close.fa.fa-times-thin
  35. #viewer-container
  36. i.fa.fa-chevron-left.attachment-arrow#prev-attachment
  37. #viewer-content
  38. img#image-viewer.hidden
  39. video#video-viewer.hidden(controls="true")
  40. audio#audio-viewer.hidden(controls="true")
  41. object#pdf-viewer.hidden(type="application/pdf")
  42. span.pdf-preview-error {{_ 'preview-pdf-not-supported' }}
  43. object#txt-viewer.hidden(type="text/plain")
  44. i.fa.fa-chevron-right.attachment-arrow#next-attachment
  45. template(name="attachmentGallery")
  46. .attachment-gallery
  47. a.attachment-item.add-attachment.js-add-attachment
  48. i.fa.fa-plus.icon
  49. each attachments
  50. .attachment-item
  51. .attachment-thumbnail-container.open-preview(data-attachment-id="{{_id}}" data-card-id="{{ meta.cardId }}")
  52. if link
  53. if(isImage)
  54. img.attachment-thumbnail(src="{{link}}" title="{{sanitize name}}")
  55. else if($eq extension 'svg')
  56. img.attachment-thumbnail(src="{{link}}" title="{{sanitize name}}" type="image/svg+xml")
  57. else if($eq extension 'mp3')
  58. video.attachment-thumbnail(title="{{sanitize name}}")
  59. source(src="{{link}}" type="audio/mpeg")
  60. else if($eq extension 'ogg')
  61. video.attachment-thumbnail(title="{{sanitize name}}")
  62. source(src="{{link}}" type="video/ogg")
  63. else if($eq extension 'webm')
  64. video.attachment-thumbnail(title="{{sanitize name}}")
  65. source(src="{{link}}" type="video/webm")
  66. else if($eq extension 'mp4')
  67. video.attachment-thumbnail(title="{{sanitize name}}")
  68. source(src="{{link}}" type="video/mp4")
  69. else
  70. span.attachment-thumbnail-text= extension
  71. .attachment-details-container
  72. .attachment-details
  73. div
  74. b
  75. = name
  76. span.file-size ({{fileSize size}})
  77. .attachment-actions
  78. a.js-download(href="{{link}}?download=true", download="{{name}}")
  79. i.fa.fa-download.icon(title="{{_ 'download'}}")
  80. if currentUser.isBoardMember
  81. unless currentUser.isCommentOnly
  82. unless currentUser.isWorker
  83. a.js-rename
  84. i.fa.fa-pen-to-square.icon(title="{{_ 'rename'}}")
  85. a.js-confirm-delete
  86. i.fa.fa-trash.icon(title="{{_ 'delete'}}")
  87. a.fa.fa-navicon.icon.js-open-attachment-menu(data-attachment-link="{{link}}" title="{{_ 'attachmentActionsPopup-title'}}")
  88. template(name="attachmentActionsPopup")
  89. ul.pop-over-list
  90. li
  91. if isImage
  92. a(class="{{#if isCover}}js-remove-cover{{else}}js-add-cover{{/if}}")
  93. i.fa.fa-book
  94. i.fa.fa-image
  95. if isCover
  96. | {{_ 'remove-cover'}}
  97. else
  98. | {{_ 'add-cover'}}
  99. if currentUser.isBoardAdmin
  100. if isImage
  101. a(class="{{#if isBackgroundImage}}js-remove-background-image{{else}}js-add-background-image{{/if}}")
  102. i.fa.fa-image
  103. if isBackgroundImage
  104. | {{_ 'remove-background-image'}}
  105. else
  106. | {{_ 'add-background-image'}}
  107. p.attachment-storage
  108. | {{versions.original.storage}}
  109. if $neq versions.original.storage "fs"
  110. a.js-move-storage-fs
  111. i.fa.fa-arrow-right
  112. | {{_ 'attachment-move-storage-fs'}}
  113. if $neq versions.original.storage "gridfs"
  114. if versions.original.storage
  115. a.js-move-storage-gridfs
  116. i.fa.fa-arrow-right
  117. | {{_ 'attachment-move-storage-gridfs'}}
  118. if $neq versions.original.storage "s3"
  119. if versions.original.storage
  120. a.js-move-storage-s3
  121. i.fa.fa-arrow-right
  122. | {{_ 'attachment-move-storage-s3'}}
  123. template(name="attachmentRenamePopup")
  124. input.js-edit-attachment-name(type='text' autofocus value="{{getNameWithoutExtension}}" dir="auto")
  125. .edit-controls.clearfix
  126. button.primary.confirm.js-submit-edit-attachment-name(type="submit") {{_ 'save'}}