minicard.jade 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. .minicard-title
  35. if $eq 'prefix-with-full-path' currentBoard.presentParentTask
  36. .parent-prefix
  37. | {{ parentString ' > ' }}
  38. if $eq 'prefix-with-parent' currentBoard.presentParentTask
  39. .parent-prefix
  40. | {{ parentCardName }}
  41. if isLinkedBoard
  42. a.js-linked-link
  43. span.linked-icon.fa.fa-folder
  44. else if isLinkedCard
  45. a.js-linked-link
  46. span.linked-icon.fa.fa-id-card
  47. if getArchived
  48. span.linked-icon.linked-archived.fa.fa-archive
  49. +viewer
  50. if currentBoard.allowsCardNumber
  51. span.card-number
  52. | ##{getCardNumber}
  53. = getTitle
  54. if $eq 'subtext-with-full-path' currentBoard.presentParentTask
  55. .parent-subtext
  56. | {{ parentString ' > ' }}
  57. if $eq 'subtext-with-parent' currentBoard.presentParentTask
  58. .parent-subtext
  59. | {{ parentCardName }}
  60. if labels
  61. .minicard-labels(class="{{#if hiddenMinicardLabelText}}minicard-labels-no-text{{/if}}")
  62. each labels
  63. unless hiddenMinicardLabelText
  64. span.js-card-label.card-label(class="card-label-{{color}}" title=name)
  65. +viewer
  66. = name
  67. if hiddenMinicardLabelText
  68. .minicard-label(class="card-label-{{color}}" title="{{name}}")
  69. .minicard-custom-fields
  70. each customFieldsWD
  71. if definition.showOnCard
  72. if trueValue
  73. .minicard-custom-field
  74. // If there is custom field label, show label at left,
  75. // and value at right
  76. if definition.showLabelOnMiniCard
  77. .minicard-custom-field-item
  78. +viewer
  79. = definition.name
  80. .minicard-custom-field-item
  81. if $eq definition.type "currency"
  82. +viewer
  83. = formattedCurrencyCustomFieldValue(definition)
  84. else if $eq definition.type "date"
  85. .date
  86. +minicardCustomFieldDate
  87. else if $eq definition.type "checkbox"
  88. .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
  89. else if $eq definition.type "stringtemplate"
  90. +viewer
  91. = formattedStringtemplateCustomFieldValue(definition)
  92. else
  93. +viewer
  94. = trueValue
  95. else
  96. // If there is no custom field label,
  97. // show value full width
  98. .minicard-custom-field-item-fullwidth
  99. if $eq definition.type "currency"
  100. +viewer
  101. = formattedCurrencyCustomFieldValue(definition)
  102. else if $eq definition.type "date"
  103. .date
  104. +minicardCustomFieldDate
  105. else if $eq definition.type "checkbox"
  106. .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
  107. else if $eq definition.type "stringtemplate"
  108. +viewer
  109. = formattedStringtemplateCustomFieldValue(definition)
  110. else
  111. +viewer
  112. = trueValue
  113. .card-checklist-attachmentGalleries
  114. .card-checklist-attachmentGallery.card-checklists
  115. if currentBoard.allowsChecklists
  116. //hr
  117. //+checklists(cardId=_id showAtMinicard=true)
  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 showCreatorOnMinicard
  129. .minicard-creator
  130. +userAvatar(userId=this.userId noRemove=true)
  131. .badges
  132. if canModifyCard
  133. if comments.length
  134. .badge(title="{{_ 'card-comments-title' comments.length }}")
  135. span.badge-icon.fa.fa-comment-o.badge-comment.badge-text
  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 canModifyCard
  186. li
  187. a.js-move-card
  188. i.fa.fa-arrow-right
  189. | {{_ 'moveCardPopup-title'}}
  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'}}