attachments.jade 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.isBoardAdmin
  81. a.js-rename
  82. i.fa.fa-pencil-square-o.icon(title="{{_ 'rename'}}")
  83. a.js-confirm-delete
  84. i.fa.fa-trash.icon(title="{{_ 'delete'}}")
  85. if currentUser.isBoardMember
  86. unless currentUser.isCommentOnly
  87. unless currentUser.isWorker
  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. p.attachment-storage
  109. | {{versions.original.storage}}
  110. if $neq versions.original.storage "fs"
  111. a.js-move-storage-fs
  112. i.fa.fa-arrow-right
  113. | {{_ 'attachment-move-storage-fs'}}
  114. if $neq versions.original.storage "gridfs"
  115. if versions.original.storage
  116. a.js-move-storage-gridfs
  117. i.fa.fa-arrow-right
  118. | {{_ 'attachment-move-storage-gridfs'}}
  119. if $neq versions.original.storage "s3"
  120. if versions.original.storage
  121. a.js-move-storage-s3
  122. i.fa.fa-arrow-right
  123. | {{_ 'attachment-move-storage-s3'}}
  124. template(name="attachmentRenamePopup")
  125. input.js-edit-attachment-name(type='text' autofocus value="{{getNameWithoutExtension}}" dir="auto")
  126. .edit-controls.clearfix
  127. button.primary.confirm.js-submit-edit-attachment-name(type="submit") {{_ 'save'}}