attachments.jade 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. if canModifyCard
  48. a.attachment-item.add-attachment.js-add-attachment
  49. i.fa.fa-plus.icon
  50. each attachments
  51. .attachment-item
  52. .attachment-thumbnail-container.open-preview(data-attachment-id="{{_id}}" data-card-id="{{ meta.cardId }}")
  53. if link
  54. if(isImage)
  55. img.attachment-thumbnail(src="{{link}}" title="{{sanitize name}}")
  56. else if($eq extension 'svg')
  57. img.attachment-thumbnail(src="{{link}}" title="{{sanitize name}}" type="image/svg+xml")
  58. else if($eq extension 'mp3')
  59. video.attachment-thumbnail(title="{{sanitize name}}")
  60. source(src="{{link}}" type="audio/mpeg")
  61. else if($eq extension 'ogg')
  62. video.attachment-thumbnail(title="{{sanitize name}}")
  63. source(src="{{link}}" type="video/ogg")
  64. else if($eq extension 'webm')
  65. video.attachment-thumbnail(title="{{sanitize name}}")
  66. source(src="{{link}}" type="video/webm")
  67. else if($eq extension 'mp4')
  68. video.attachment-thumbnail(title="{{sanitize name}}")
  69. source(src="{{link}}" type="video/mp4")
  70. else
  71. span.attachment-thumbnail-text= extension
  72. .attachment-details-container
  73. .attachment-details
  74. div
  75. b
  76. = name
  77. span.file-size ({{fileSize size}})
  78. .attachment-actions
  79. a.js-download(href="{{link}}?download=true", download="{{name}}")
  80. i.fa.fa-download.icon(title="{{_ 'download'}}")
  81. if currentUser.isBoardMember
  82. unless currentUser.isCommentOnly
  83. unless currentUser.isWorker
  84. a.js-rename
  85. i.fa.fa-pencil-square-o.icon(title="{{_ 'rename'}}")
  86. a.js-confirm-delete
  87. i.fa.fa-trash.icon(title="{{_ 'delete'}}")
  88. a.fa.fa-navicon.icon.js-open-attachment-menu(data-attachment-link="{{link}}" title="{{_ 'attachmentActionsPopup-title'}}")
  89. template(name="attachmentActionsPopup")
  90. ul.pop-over-list
  91. li
  92. if isImage
  93. a(class="{{#if isCover}}js-remove-cover{{else}}js-add-cover{{/if}}")
  94. i.fa.fa-book
  95. i.fa.fa-picture-o
  96. if isCover
  97. | {{_ 'remove-cover'}}
  98. else
  99. | {{_ 'add-cover'}}
  100. if currentUser.isBoardAdmin
  101. if isImage
  102. a(class="{{#if isBackgroundImage}}js-remove-background-image{{else}}js-add-background-image{{/if}}")
  103. i.fa.fa-picture-o
  104. if isBackgroundImage
  105. | {{_ 'remove-background-image'}}
  106. else
  107. | {{_ 'add-background-image'}}
  108. if $neq versions.original.storage "fs"
  109. a.js-move-storage-fs
  110. i.fa.fa-arrow-right
  111. | {{_ 'attachment-move-storage-fs'}}
  112. if $neq versions.original.storage "gridfs"
  113. if versions.original.storage
  114. a.js-move-storage-gridfs
  115. i.fa.fa-arrow-right
  116. | {{_ 'attachment-move-storage-gridfs'}}
  117. if $neq versions.original.storage "s3"
  118. if versions.original.storage
  119. a.js-move-storage-s3
  120. i.fa.fa-arrow-right
  121. | {{_ 'attachment-move-storage-s3'}}
  122. template(name="attachmentRenamePopup")
  123. input.js-edit-attachment-name(type='text' autofocus value="{{getNameWithoutExtension}}" dir="auto")
  124. .edit-controls.clearfix
  125. button.primary.confirm.js-submit-edit-attachment-name(type="submit") {{_ 'save'}}