minicard.jade 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. template(name="minicard")
  2. .minicard.nodragscroll(
  3. class="{{#if isLinkedCard}}linked-card{{/if}}"
  4. class="{{#if isLinkedBoard}}linked-board{{/if}}"
  5. class="{{#if colorClass}}minicard-{{colorClass}}{{/if}}")
  6. if canModifyCard
  7. a.minicard-details-menu-with-handle.js-open-minicard-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}") ☰
  8. .handle
  9. | ↕️
  10. .dates
  11. if getReceived
  12. .date
  13. +minicardReceivedDate
  14. if getStart
  15. .date
  16. +minicardStartDate
  17. if getDue
  18. .date
  19. +minicardDueDate
  20. if getEnd
  21. +minicardEndDate
  22. if getSpentTime
  23. .date
  24. +cardSpentTime
  25. if cover
  26. if currentBoard.allowsCoverAttachmentOnMinicard
  27. .minicard-cover(style="background-image: url('{{cover.link 'original'}}?dummyReloadAfterSessionEstablished={{sess}}');")
  28. // Upload progress indicator for drag-and-drop uploads
  29. if hasActiveUploads
  30. .minicard-upload-progress
  31. .upload-progress-header
  32. | 📤
  33. span {{_ 'uploading-files'}} ({{uploadCount}})
  34. each uploads
  35. .upload-progress-item(class="{{#if $eq status 'error'}}upload-error{{/if}}")
  36. .upload-progress-filename {{file.name}}
  37. .upload-progress-bar
  38. .upload-progress-fill(style="width: {{progress}}%")
  39. if $eq status 'error'
  40. .upload-progress-error
  41. | ⚠️
  42. span {{_ 'upload-failed'}}
  43. else if $eq status 'completed'
  44. .upload-progress-success
  45. | ✅
  46. span {{_ 'upload-completed'}}
  47. .minicard-title
  48. if $eq 'prefix-with-full-path' currentBoard.presentParentTask
  49. .parent-prefix
  50. | {{ parentString ' > ' }}
  51. if $eq 'prefix-with-parent' currentBoard.presentParentTask
  52. .parent-prefix
  53. | {{ parentCardName }}
  54. if isLinkedBoard
  55. a.js-linked-link
  56. span.linked-icon | 📁
  57. else if isLinkedCard
  58. a.js-linked-link
  59. span.linked-icon | 🃏
  60. if getArchived
  61. span.linked-icon.linked-archived | 📦
  62. +viewer
  63. if currentBoard.allowsCardNumber
  64. span.card-number
  65. | ##{getCardNumber}
  66. = getTitle
  67. if labels
  68. .minicard-labels(class="{{#if hiddenMinicardLabelText}}minicard-labels-no-text{{/if}}")
  69. each labels
  70. unless hiddenMinicardLabelText
  71. span.js-card-label.card-label(class="card-label-{{color}}" title=name)
  72. +viewer
  73. = name
  74. if hiddenMinicardLabelText
  75. .minicard-label(class="card-label-{{color}}" title="{{name}}")
  76. .minicard-custom-fields
  77. each customFieldsWD
  78. if definition.showOnCard
  79. if trueValue
  80. .minicard-custom-field
  81. // If there is custom field label, show label at left,
  82. // and value at right
  83. if definition.showLabelOnMiniCard
  84. .minicard-custom-field-item
  85. +viewer
  86. = definition.name
  87. .minicard-custom-field-item
  88. if $eq definition.type "currency"
  89. +viewer
  90. = formattedCurrencyCustomFieldValue(definition)
  91. else if $eq definition.type "date"
  92. .date
  93. +minicardCustomFieldDate
  94. else if $eq definition.type "checkbox"
  95. .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
  96. else if $eq definition.type "stringtemplate"
  97. +viewer
  98. = formattedStringtemplateCustomFieldValue(definition)
  99. else
  100. +viewer
  101. = trueValue
  102. else
  103. // If there is no custom field label,
  104. // show value full width
  105. .minicard-custom-field-item-fullwidth
  106. if $eq definition.type "currency"
  107. +viewer
  108. = formattedCurrencyCustomFieldValue(definition)
  109. else if $eq definition.type "date"
  110. .date
  111. +minicardCustomFieldDate
  112. else if $eq definition.type "checkbox"
  113. .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
  114. else if $eq definition.type "stringtemplate"
  115. +viewer
  116. = formattedStringtemplateCustomFieldValue(definition)
  117. else
  118. +viewer
  119. = trueValue
  120. if showAssignee
  121. if getAssignees
  122. .minicard-assignees.js-minicard-assignees
  123. each getAssignees
  124. +userAvatar(userId=this)
  125. if showMembers
  126. if getMembers
  127. .minicard-members.js-minicard-members
  128. each getMembers
  129. +userAvatar(userId=this)
  130. if showCreatorOnMinicard
  131. .minicard-creator
  132. +userAvatar(userId=this.userId noRemove=true)
  133. .badges
  134. if canModifyCard
  135. if comments.length
  136. .badge(title="{{_ 'card-comments-title' comments.length }}")
  137. span.badge-icon.badge-comment.badge-text | 💬
  138. = ' '
  139. = comments.length
  140. //span.badge-comment.badge-text
  141. //| {{_ 'comment'}}
  142. if getDescription
  143. unless currentBoard.allowsDescriptionTextOnMinicard
  144. .badge.badge-state-image-only(title=getDescription)
  145. span.badge-icon | 📝
  146. if getVoteQuestion
  147. .badge.badge-state-image-only(title=getVoteQuestion)
  148. span.badge-icon(class="{{#if voteState}}text-green{{/if}}") | 👍
  149. span.badge-text {{ voteCountPositive }}
  150. span.badge-icon(class="{{#if $eq voteState false}}text-red{{/if}}") | 👎
  151. span.badge-text {{ voteCountNegative }}
  152. if getPokerQuestion
  153. .badge.badge-state-image-only(title=getPokerQuestion)
  154. span.badge-icon(class="{{#if pokerState}}text-green{{/if}}") | ✅
  155. if expiredPoker
  156. span.badge-text {{ getPokerEstimation }}
  157. if attachments.length
  158. if currentBoard.allowsBadgeAttachmentOnMinicard
  159. .badge
  160. span.badge-icon | 📎
  161. span.badge-text= attachments.length
  162. if checklists.length
  163. .badge(class="{{#if checklistFinished}}is-finished{{/if}}")
  164. span.badge-icon | ☑️
  165. span.badge-text.check-list-text {{checklistFinishedCount}}/{{checklistItemCount}}
  166. if allSubtasks.count
  167. .badge
  168. span.badge-icon | 🌐
  169. span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}}
  170. //{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down
  171. if currentBoard.allowsCardSortingByNumber
  172. if currentBoard.allowsCardSortingByNumberOnMinicard
  173. .badge
  174. span.badge-icon | 🔢
  175. span.badge-text.check-list-sort {{ sort }}
  176. if currentBoard.allowsDescriptionTextOnMinicard
  177. if getDescription
  178. .minicard-description
  179. +viewer
  180. | {{ getDescription }}
  181. if shouldShowListOnMinicard
  182. .minicard-list-name
  183. | 📋
  184. | {{ listName }}
  185. if $eq 'subtext-with-full-path' currentBoard.presentParentTask
  186. .parent-subtext
  187. | {{ parentString ' > ' }}
  188. if $eq 'subtext-with-parent' currentBoard.presentParentTask
  189. .parent-subtext
  190. | {{ parentCardName }}
  191. template(name="editCardSortOrderPopup")
  192. input.js-edit-card-sort-popup(type='text' autofocus value=sort dir="auto")
  193. .edit-controls.clearfix
  194. button.primary.confirm.js-submit-edit-card-sort-popup(type="submit") {{_ 'save'}}
  195. template(name="minicardDetailsActionsPopup")
  196. ul.pop-over-list
  197. if canModifyCard
  198. li
  199. a.js-move-card
  200. | ➡️
  201. | {{_ 'moveCardPopup-title'}}
  202. li
  203. a.js-copy-card
  204. | 📋
  205. | {{_ 'copyCardPopup-title'}}
  206. hr
  207. li
  208. a.js-archive
  209. | ➡️
  210. | 📦
  211. | {{_ 'archive-card'}}
  212. hr
  213. li
  214. a.js-move-card-to-top
  215. | ⬆️
  216. | {{_ 'moveCardToTop-title'}}
  217. li
  218. a.js-move-card-to-bottom
  219. | ⬇️
  220. | {{_ 'moveCardToBottom-title'}}
  221. hr
  222. li
  223. a.js-add-labels
  224. | 🏷️
  225. | {{_ 'card-edit-labels'}}
  226. li
  227. a.js-due-date
  228. | 📥
  229. | {{_ 'editCardDueDatePopup-title'}}
  230. li
  231. a.js-set-card-color
  232. | 🎨
  233. | {{_ 'setCardColorPopup-title'}}
  234. li
  235. a.js-link
  236. | 🔗
  237. | {{_ 'link-card'}}
  238. li
  239. a.js-toggle-watch-card
  240. if isWatching
  241. | 👁️
  242. | {{_ 'unwatch'}}
  243. else
  244. | 👁️-slash
  245. | {{_ 'watch'}}