attachments.jade 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. template(name="cardAttachmentsPopup")
  2. ul.pop-over-list
  3. li
  4. input.js-attach-file.hide(type="file" name="file" multiple)
  5. a.js-computer-upload {{_ 'computer'}}
  6. li
  7. a.js-upload-clipboard-image {{_ 'clipboard'}}
  8. template(name="previewClipboardImagePopup")
  9. p <kbd>Ctrl</kbd>+<kbd>V</kbd> {{_ "paste-or-dragdrop"}}
  10. img.preview-clipboard-image()
  11. button.primary.js-upload-pasted-image {{_ 'upload'}}
  12. template(name="attachmentDeletePopup")
  13. p {{_ "attachment-delete-pop"}}
  14. button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
  15. template(name="attachmentsGalery")
  16. .attachments-galery
  17. each attachments
  18. .attachment-item
  19. // TODO: Add popup of attachment image later, with some swipebox or lightbox that would not add bugs
  20. // a.attachment-thumbnail(href="{{link}}" title="{{name}}")
  21. span.attachment-thumbnail(href="{{link}}" title="{{name}}")
  22. if link
  23. if isImage
  24. img.attachment-thumbnail-img(src="{{link}}")
  25. else if($eq extension 'mp3')
  26. video(width="100%" height="100%" controls="true")
  27. source(src="{{link}}" type="audio/mpeg")
  28. else if($eq extension 'ogg')
  29. video(width="100%" height="100%" controls="true")
  30. source(src="{{link}}" type="video/ogg")
  31. else if($eq extension 'webm')
  32. video(width="100%" height="100%" controls="true")
  33. source(src="{{link}}" type="video/webm")
  34. else if($eq extension 'mp4')
  35. video(width="100%" height="100%" controls="true")
  36. source(src="{{link}}" type="video/mp4")
  37. else
  38. span.attachment-thumbnail-ext= extension
  39. else
  40. +spinner
  41. p.attachment-details
  42. = name
  43. span.file-size ({{fileSize size}} KB)
  44. span.attachment-details-actions
  45. a.js-download(href="{{link}}?download=true", download="{{name}}")
  46. i.fa.fa-download
  47. | {{_ 'download'}}
  48. if currentUser.isBoardMember
  49. unless currentUser.isCommentOnly
  50. unless currentUser.isWorker
  51. a.fa.fa-navicon.attachment-details-menu.js-open-attachment-menu(title="{{_ 'attachmentActionsPopup-title'}}")
  52. if currentUser.isBoardMember
  53. unless currentUser.isCommentOnly
  54. unless currentUser.isWorker
  55. //li.attachment-item.add-attachment
  56. a.js-add-attachment(title="{{_ 'add-attachment' }}")
  57. i.fa.fa-plus
  58. template(name="attachmentActionsPopup")
  59. ul.pop-over-list
  60. li
  61. if isImage
  62. a(class="{{#if isCover}}js-remove-cover{{else}}js-add-cover{{/if}}")
  63. i.fa.fa-thumb-tack
  64. if isCover
  65. | {{_ 'remove-cover'}}
  66. else
  67. | {{_ 'add-cover'}}
  68. if currentUser.isBoardAdmin
  69. a.js-rename
  70. i.fa.fa-pencil-square-o
  71. | {{_ 'rename'}}
  72. a.js-confirm-delete
  73. i.fa.fa-close
  74. | {{_ 'delete'}}
  75. p.attachment-storage
  76. | {{versions.original.storage}}
  77. if $neq versions.original.storage "fs"
  78. a.js-move-storage-fs
  79. i.fa.fa-arrow-right
  80. | {{_ 'attachment-move-storage-fs'}}
  81. if $neq versions.original.storage "gridfs"
  82. if versions.original.storage
  83. a.js-move-storage-gridfs
  84. i.fa.fa-arrow-right
  85. | {{_ 'attachment-move-storage-gridfs'}}
  86. template(name="attachmentRenamePopup")
  87. input.js-edit-attachment-name(type='text' autofocus value="{{getNameWithoutExtension}}" dir="auto")
  88. .edit-controls.clearfix
  89. button.primary.confirm.js-submit-edit-attachment-name(type="submit") {{_ 'save'}}