minicard.jade 8.4 KB

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