minicard.jade 8.2 KB

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