minicard.jade 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. .card-checklist-attachmentGalleries
  113. .card-checklist-attachmentGallery.card-checklists
  114. if currentBoard.allowsChecklists
  115. //hr
  116. //+checklists(cardId=_id showAtMinicard=true)
  117. if showAssignee
  118. if getAssignees
  119. .minicard-assignees.js-minicard-assignees
  120. each getAssignees
  121. +userAvatar(userId=this)
  122. if showMembers
  123. if getMembers
  124. .minicard-members.js-minicard-members
  125. each getMembers
  126. +userAvatar(userId=this)
  127. if showCreator
  128. .minicard-creator
  129. +userAvatar(userId=this.userId noRemove=true)
  130. .badges
  131. unless currentUser.isNoComments
  132. if comments.length
  133. .badge(title="{{_ 'card-comments-title' comments.length }}")
  134. span.badge-icon.fa.fa-comment-o.badge-comment
  135. = ' '
  136. = comments.length
  137. //span.badge-comment.badge-text
  138. //| {{_ 'comment'}}
  139. if getDescription
  140. unless currentBoard.allowsDescriptionTextOnMinicard
  141. .badge.badge-state-image-only(title=getDescription)
  142. span.badge-icon.fa.fa-align-left
  143. if getVoteQuestion
  144. .badge.badge-state-image-only(title=getVoteQuestion)
  145. span.badge-icon.fa.fa-thumbs-up(class="{{#if voteState}}text-green{{/if}}")
  146. span.badge-text {{ voteCountPositive }}
  147. span.badge-icon.fa.fa-thumbs-down(class="{{#if $eq voteState false}}text-red{{/if}}")
  148. span.badge-text {{ voteCountNegative }}
  149. if getPokerQuestion
  150. .badge.badge-state-image-only(title=getPokerQuestion)
  151. span.badge-icon.fa.fa-check(class="{{#if pokerState}}text-green{{/if}}")
  152. if expiredPoker
  153. span.badge-text {{ getPokerEstimation }}
  154. if attachments.length
  155. if currentBoard.allowsBadgeAttachmentOnMinicard
  156. .badge
  157. span.badge-icon.fa.fa-paperclip
  158. span.badge-text= attachments.length
  159. if checklists.length
  160. .badge(class="{{#if checklistFinished}}is-finished{{/if}}")
  161. span.badge-icon.fa.fa-check-square-o
  162. span.badge-text.check-list-text {{checklistFinishedCount}}/{{checklistItemCount}}
  163. if allSubtasks.count
  164. .badge
  165. span.badge-icon.fa.fa-sitemap
  166. span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}}
  167. //{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down
  168. if currentBoard.allowsCardSortingByNumber
  169. if currentBoard.allowsCardSortingByNumberOnMinicard
  170. .badge
  171. span.badge-icon.fa.fa-sort
  172. span.badge-text.check-list-sort {{ sort }}
  173. if currentBoard.allowsDescriptionTextOnMinicard
  174. if getDescription
  175. .minicard-description
  176. +viewer
  177. | {{ getDescription }}
  178. template(name="editCardSortOrderPopup")
  179. input.js-edit-card-sort-popup(type='text' autofocus value=sort dir="auto")
  180. .edit-controls.clearfix
  181. button.primary.confirm.js-submit-edit-card-sort-popup(type="submit") {{_ 'save'}}
  182. template(name="minicardDetailsActionsPopup")
  183. ul.pop-over-list
  184. if currentUser.isBoardAdmin
  185. li
  186. a.js-move-card
  187. i.fa.fa-arrow-right
  188. | {{_ 'moveCardPopup-title'}}
  189. unless currentUser.isWorker
  190. li
  191. a.js-copy-card
  192. i.fa.fa-copy
  193. | {{_ 'copyCardPopup-title'}}
  194. hr
  195. li
  196. a.js-archive
  197. i.fa.fa-arrow-right
  198. i.fa.fa-archive
  199. | {{_ 'archive-card'}}
  200. hr
  201. li
  202. a.js-move-card-to-top
  203. i.fa.fa-arrow-up
  204. | {{_ 'moveCardToTop-title'}}
  205. li
  206. a.js-move-card-to-bottom
  207. i.fa.fa-arrow-down
  208. | {{_ 'moveCardToBottom-title'}}
  209. hr
  210. li
  211. a.js-add-labels
  212. i.fa.fa-tags
  213. | {{_ 'card-edit-labels'}}
  214. li
  215. a.js-due-date
  216. i.fa.fa-sign-in
  217. | {{_ 'editCardDueDatePopup-title'}}
  218. li
  219. a.js-set-card-color
  220. i.fa.fa-paint-brush
  221. | {{_ 'setCardColorPopup-title'}}
  222. li
  223. a.js-link
  224. i.fa.fa-link
  225. | {{_ 'link-card'}}