attachments.jade 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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="attachmentsGalery")
  31. .attachments-galery
  32. each attachments
  33. .attachment-item
  34. a.attachment-thumbnail.swipebox(href="{{link}}" title="{{name}}")
  35. if link
  36. if isImage
  37. img.attachment-thumbnail-img(src="{{link}}")
  38. else if($eq extension 'mp3')
  39. video(width="100%" height="100%" controls="true")
  40. source(src="{{link}}" type="audio/mpeg")
  41. else if($eq extension 'ogg')
  42. video(width="100%" height="100%" controls="true")
  43. source(src="{{link}}" type="video/ogg")
  44. else if($eq extension 'webm')
  45. video(width="100%" height="100%" controls="true")
  46. source(src="{{link}}" type="video/webm")
  47. else if($eq extension 'mp4')
  48. video(width="100%" height="100%" controls="true")
  49. source(src="{{link}}" type="video/mp4")
  50. else
  51. span.attachment-thumbnail-ext= extension
  52. p.attachment-details
  53. = name
  54. span.file-size ({{fileSize size}})
  55. span.attachment-details-actions
  56. a.js-download(href="{{link}}?download=true", download="{{name}}")
  57. i.fa.fa-download
  58. | {{_ 'download'}}
  59. if currentUser.isBoardMember
  60. unless currentUser.isCommentOnly
  61. unless currentUser.isWorker
  62. a.fa.fa-navicon.attachment-details-menu.js-open-attachment-menu(title="{{_ 'attachmentActionsPopup-title'}}")
  63. if currentUser.isBoardMember
  64. unless currentUser.isCommentOnly
  65. unless currentUser.isWorker
  66. //li.attachment-item.add-attachment
  67. a.js-add-attachment(title="{{_ 'add-attachment' }}")
  68. i.fa.fa-plus
  69. template(name="attachmentActionsPopup")
  70. ul.pop-over-list
  71. li
  72. if isImage
  73. a(class="{{#if isCover}}js-remove-cover{{else}}js-add-cover{{/if}}")
  74. i.fa.fa-thumb-tack
  75. if isCover
  76. | {{_ 'remove-cover'}}
  77. else
  78. | {{_ 'add-cover'}}
  79. if currentUser.isBoardAdmin
  80. a.js-rename
  81. i.fa.fa-pencil-square-o
  82. | {{_ 'rename'}}
  83. a.js-confirm-delete
  84. i.fa.fa-close
  85. | {{_ 'delete'}}
  86. p.attachment-storage
  87. | {{versions.original.storage}}
  88. if $neq versions.original.storage "fs"
  89. a.js-move-storage-fs
  90. i.fa.fa-arrow-right
  91. | {{_ 'attachment-move-storage-fs'}}
  92. if $neq versions.original.storage "gridfs"
  93. if versions.original.storage
  94. a.js-move-storage-gridfs
  95. i.fa.fa-arrow-right
  96. | {{_ 'attachment-move-storage-gridfs'}}
  97. template(name="attachmentRenamePopup")
  98. input.js-edit-attachment-name(type='text' autofocus value="{{getNameWithoutExtension}}" dir="auto")
  99. .edit-controls.clearfix
  100. button.primary.confirm.js-submit-edit-attachment-name(type="submit") {{_ 'save'}}