minicard.jade 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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 shouldShowListOnMinicard
  74. .minicard-list-name
  75. i.fa.fa-list
  76. | {{ listName }}
  77. if $eq 'subtext-with-full-path' currentBoard.presentParentTask
  78. .parent-subtext
  79. | {{ parentString ' > ' }}
  80. if $eq 'subtext-with-parent' currentBoard.presentParentTask
  81. .parent-subtext
  82. | {{ parentCardName }}
  83. if labels
  84. .minicard-labels(class="{{#if hiddenMinicardLabelText}}minicard-labels-no-text{{/if}}")
  85. each labels
  86. unless hiddenMinicardLabelText
  87. span.js-card-label.card-label(class="card-label-{{color}}" title=name)
  88. +viewer
  89. = name
  90. if hiddenMinicardLabelText
  91. .minicard-label(class="card-label-{{color}}" title="{{name}}")
  92. .minicard-custom-fields
  93. each customFieldsWD
  94. if definition.showOnCard
  95. if trueValue
  96. .minicard-custom-field
  97. // If there is custom field label, show label at left,
  98. // and value at right
  99. if definition.showLabelOnMiniCard
  100. .minicard-custom-field-item
  101. +viewer
  102. = definition.name
  103. .minicard-custom-field-item
  104. if $eq definition.type "currency"
  105. +viewer
  106. = formattedCurrencyCustomFieldValue(definition)
  107. else if $eq definition.type "date"
  108. .date
  109. +minicardCustomFieldDate
  110. else if $eq definition.type "checkbox"
  111. .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
  112. else if $eq definition.type "stringtemplate"
  113. +viewer
  114. = formattedStringtemplateCustomFieldValue(definition)
  115. else
  116. +viewer
  117. = trueValue
  118. else
  119. // If there is no custom field label,
  120. // show value full width
  121. .minicard-custom-field-item-fullwidth
  122. if $eq definition.type "currency"
  123. +viewer
  124. = formattedCurrencyCustomFieldValue(definition)
  125. else if $eq definition.type "date"
  126. .date
  127. +minicardCustomFieldDate
  128. else if $eq definition.type "checkbox"
  129. .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
  130. else if $eq definition.type "stringtemplate"
  131. +viewer
  132. = formattedStringtemplateCustomFieldValue(definition)
  133. else
  134. +viewer
  135. = trueValue
  136. if showAssignee
  137. if getAssignees
  138. .minicard-assignees.js-minicard-assignees
  139. each getAssignees
  140. +userAvatar(userId=this)
  141. if showMembers
  142. if getMembers
  143. .minicard-members.js-minicard-members
  144. each getMembers
  145. +userAvatar(userId=this)
  146. if showCreatorOnMinicard
  147. .minicard-creator
  148. +userAvatar(userId=this.userId noRemove=true)
  149. .badges
  150. if canModifyCard
  151. if comments.length
  152. .badge(title="{{_ 'card-comments-title' comments.length }}")
  153. span.badge-icon.fa.fa-comment-o.badge-comment.badge-text
  154. = ' '
  155. = comments.length
  156. //span.badge-comment.badge-text
  157. //| {{_ 'comment'}}
  158. if getDescription
  159. unless currentBoard.allowsDescriptionTextOnMinicard
  160. .badge.badge-state-image-only(title=getDescription)
  161. span.badge-icon.fa.fa-align-left
  162. if getVoteQuestion
  163. .badge.badge-state-image-only(title=getVoteQuestion)
  164. span.badge-icon.fa.fa-thumbs-up(class="{{#if voteState}}text-green{{/if}}")
  165. span.badge-text {{ voteCountPositive }}
  166. span.badge-icon.fa.fa-thumbs-down(class="{{#if $eq voteState false}}text-red{{/if}}")
  167. span.badge-text {{ voteCountNegative }}
  168. if getPokerQuestion
  169. .badge.badge-state-image-only(title=getPokerQuestion)
  170. span.badge-icon.fa.fa-check(class="{{#if pokerState}}text-green{{/if}}")
  171. if expiredPoker
  172. span.badge-text {{ getPokerEstimation }}
  173. if attachments.length
  174. if currentBoard.allowsBadgeAttachmentOnMinicard
  175. .badge
  176. span.badge-icon.fa.fa-paperclip
  177. span.badge-text= attachments.length
  178. if checklists.length
  179. .badge(class="{{#if checklistFinished}}is-finished{{/if}}")
  180. span.badge-icon.fa.fa-check-square-o
  181. span.badge-text.check-list-text {{checklistFinishedCount}}/{{checklistItemCount}}
  182. if allSubtasks.count
  183. .badge
  184. span.badge-icon.fa.fa-sitemap
  185. span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}}
  186. //{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down
  187. if currentBoard.allowsCardSortingByNumber
  188. if currentBoard.allowsCardSortingByNumberOnMinicard
  189. .badge
  190. span.badge-icon.fa.fa-sort
  191. span.badge-text.check-list-sort {{ sort }}
  192. if currentBoard.allowsDescriptionTextOnMinicard
  193. if getDescription
  194. .minicard-description
  195. +viewer
  196. | {{ getDescription }}
  197. template(name="editCardSortOrderPopup")
  198. input.js-edit-card-sort-popup(type='text' autofocus value=sort dir="auto")
  199. .edit-controls.clearfix
  200. button.primary.confirm.js-submit-edit-card-sort-popup(type="submit") {{_ 'save'}}
  201. template(name="minicardDetailsActionsPopup")
  202. ul.pop-over-list
  203. if canModifyCard
  204. li
  205. a.js-move-card
  206. i.fa.fa-arrow-right
  207. | {{_ 'moveCardPopup-title'}}
  208. li
  209. a.js-copy-card
  210. i.fa.fa-copy
  211. | {{_ 'copyCardPopup-title'}}
  212. hr
  213. li
  214. a.js-archive
  215. i.fa.fa-arrow-right
  216. i.fa.fa-archive
  217. | {{_ 'archive-card'}}
  218. hr
  219. li
  220. a.js-move-card-to-top
  221. i.fa.fa-arrow-up
  222. | {{_ 'moveCardToTop-title'}}
  223. li
  224. a.js-move-card-to-bottom
  225. i.fa.fa-arrow-down
  226. | {{_ 'moveCardToBottom-title'}}
  227. hr
  228. li
  229. a.js-add-labels
  230. i.fa.fa-tags
  231. | {{_ 'card-edit-labels'}}
  232. li
  233. a.js-due-date
  234. i.fa.fa-sign-in
  235. | {{_ 'editCardDueDatePopup-title'}}
  236. li
  237. a.js-set-card-color
  238. i.fa.fa-paint-brush
  239. | {{_ 'setCardColorPopup-title'}}
  240. li
  241. a.js-link
  242. i.fa.fa-link
  243. | {{_ 'link-card'}}
  244. li
  245. a.js-toggle-watch-card
  246. if isWatching
  247. i.fa.fa-eye
  248. | {{_ 'unwatch'}}
  249. else
  250. i.fa.fa-eye-slash
  251. | {{_ 'watch'}}