attachments.jade 5.5 KB

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