minicard.jade 9.1 KB

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