minicard.jade 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 isMiniScreenOrShowDesktopDragHandles
  7. .handle
  8. .fa.fa-arrows
  9. if cover
  10. .minicard-cover(style="background-image: url('{{cover.url}}');")
  11. if labels
  12. .minicard-labels(class="{{#if hiddenMinicardLabelText}}minicard-labels-no-text{{/if}}")
  13. each labels
  14. unless hiddenMinicardLabelText
  15. span.js-card-label.card-label(class="card-label-{{color}}" title=name)
  16. +viewer
  17. = name
  18. if hiddenMinicardLabelText
  19. .minicard-label(class="card-label-{{color}}" title="{{name}}")
  20. .minicard-title
  21. if $eq 'prefix-with-full-path' currentBoard.presentParentTask
  22. .parent-prefix
  23. | {{ parentString ' > ' }}
  24. if $eq 'prefix-with-parent' currentBoard.presentParentTask
  25. .parent-prefix
  26. | {{ parentCardName }}
  27. if isLinkedBoard
  28. a.js-linked-link
  29. span.linked-icon.fa.fa-folder
  30. else if isLinkedCard
  31. a.js-linked-link
  32. span.linked-icon.fa.fa-id-card
  33. if getArchived
  34. span.linked-icon.linked-archived.fa.fa-archive
  35. +viewer
  36. if currentBoard.allowsCardNumber
  37. span.card-number
  38. | ##{getCardNumber}
  39. = getTitle
  40. if $eq 'subtext-with-full-path' currentBoard.presentParentTask
  41. .parent-subtext
  42. | {{ parentString ' > ' }}
  43. if $eq 'subtext-with-parent' currentBoard.presentParentTask
  44. .parent-subtext
  45. | {{ parentCardName }}
  46. .dates
  47. if getReceived
  48. unless getStart
  49. unless getDue
  50. unless getEnd
  51. .date
  52. +minicardReceivedDate
  53. if getStart
  54. .date
  55. +minicardStartDate
  56. if getDue
  57. .date
  58. +minicardDueDate
  59. if getEnd
  60. +minicardEndDate
  61. if getSpentTime
  62. .date
  63. +cardSpentTime
  64. .minicard-custom-fields
  65. each customFieldsWD
  66. if definition.showOnCard
  67. if trueValue
  68. .minicard-custom-field
  69. if definition.showLabelOnMiniCard
  70. .minicard-custom-field-item
  71. +viewer
  72. = definition.name
  73. .minicard-custom-field-item
  74. if $eq definition.type "currency"
  75. +viewer
  76. = formattedCurrencyCustomFieldValue(definition)
  77. else if $eq definition.type "date"
  78. .date
  79. +minicardCustomFieldDate
  80. else if $eq definition.type "checkbox"
  81. .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
  82. else if $eq definition.type "stringtemplate"
  83. +viewer
  84. = formattedStringtemplateCustomFieldValue(definition)
  85. else
  86. +viewer
  87. = trueValue
  88. if getAssignees
  89. .minicard-assignees.js-minicard-assignees
  90. each getAssignees
  91. +userAvatar(userId=this)
  92. if getMembers
  93. .minicard-members.js-minicard-members
  94. each getMembers
  95. +userAvatar(userId=this)
  96. if showCreator
  97. .minicard-creator
  98. +userAvatar(userId=this.userId noRemove=true)
  99. .badges
  100. unless currentUser.isNoComments
  101. if comments.count
  102. .badge(title="{{_ 'card-comments-title' comments.count }}")
  103. span.badge-icon.fa.fa-comment-o.badge-comment
  104. = ' '
  105. = comments.count
  106. //span.badge-comment.badge-text
  107. //| {{_ 'comment'}}
  108. if getDescription
  109. .badge.badge-state-image-only(title=getDescription)
  110. span.badge-icon.fa.fa-align-left
  111. if getVoteQuestion
  112. .badge.badge-state-image-only(title=getVoteQuestion)
  113. span.badge-icon.fa.fa-thumbs-up(class="{{#if voteState}}text-green{{/if}}")
  114. span.badge-text {{ voteCountPositive }}
  115. span.badge-icon.fa.fa-thumbs-down(class="{{#if $eq voteState false}}text-red{{/if}}")
  116. span.badge-text {{ voteCountNegative }}
  117. if getPokerQuestion
  118. .badge.badge-state-image-only(title=getPokerQuestion)
  119. span.badge-icon.fa.fa-check(class="{{#if pokerState}}text-green{{/if}}")
  120. if expiredPoker
  121. span.badge-text {{ getPokerEstimation }}
  122. if attachments.count
  123. .badge
  124. span.badge-icon.fa.fa-paperclip
  125. span.badge-text= attachments.count
  126. if checklists.count
  127. .badge(class="{{#if checklistFinished}}is-finished{{/if}}")
  128. span.badge-icon.fa.fa-check-square-o
  129. span.badge-text.check-list-text {{checklistFinishedCount}}/{{checklistItemCount}}
  130. if allSubtasks.count
  131. .badge
  132. span.badge-icon.fa.fa-sitemap
  133. span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}}
  134. //{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down
  135. if currentBoard.allowsCardSortingByNumber
  136. .badge
  137. span.badge-icon.fa.fa-sort
  138. span.badge-text.check-list-sort {{ sort }}
  139. template(name="editCardSortOrderPopup")
  140. input.js-edit-card-sort-popup(type='text' autofocus value=sort dir="auto")
  141. .edit-controls.clearfix
  142. button.primary.confirm.js-submit-edit-card-sort-popup(type="submit") {{_ 'save'}}