activities.jade 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. template(name="activities")
  2. .activities.js-sidebar-activities
  3. //- We should use Template.dynamic here but there is a bug with
  4. //- blaze-components: https://github.com/peerlibrary/meteor-blaze-components/issues/30
  5. if $eq mode "board"
  6. +boardActivities
  7. else
  8. +cardActivities
  9. template(name="boardActivities")
  10. each currentBoard.activities
  11. .activity
  12. +userAvatar(userId=user._id)
  13. p.activity-desc
  14. +memberName(user=user)
  15. if($eq activityType 'deleteAttachment')
  16. | {{{_ 'activity-delete-attach' cardLink}}}.
  17. if($eq activityType 'addAttachment')
  18. | {{{_ 'activity-attached' attachmentLink cardLink}}}.
  19. if($eq activityType 'addBoardMember')
  20. | {{{_ 'activity-added' memberLink boardLabel}}}.
  21. if($eq activityType 'addComment')
  22. | {{{_ 'activity-on' cardLink}}}
  23. a.activity-comment(href="{{ card.absoluteUrl }}")
  24. +viewer
  25. = comment.text
  26. if($eq activityType 'addChecklist')
  27. | {{{_ 'activity-checklist-added' cardLink}}}.
  28. .activity-checklist(href="{{ card.absoluteUrl }}")
  29. +viewer
  30. = checklist.title
  31. if($eq activityType 'removeChecklist')
  32. | {{{_ 'activity-checklist-removed' cardLink}}}.
  33. if($eq activityType 'checkedItem')
  34. | {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}.
  35. if($eq activityType 'uncheckedItem')
  36. | {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}.
  37. if($eq activityType 'checklistCompleted')
  38. | {{{_ 'activity-checklist-completed' checklist.title cardLink}}}.
  39. if($eq activityType 'checklistUncompleted')
  40. | {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}.
  41. if($eq activityType 'addChecklistItem')
  42. | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
  43. .activity-checklist(href="{{ card.absoluteUrl }}")
  44. +viewer
  45. = checklistItem.title
  46. if($eq activityType 'removedChecklistItem')
  47. | {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}.
  48. if($eq activityType 'archivedCard')
  49. | {{{_ 'activity-archived' cardLink}}}.
  50. if($eq activityType 'archivedList')
  51. | {{_ 'activity-archived' list.title}}.
  52. if($eq activityType 'archivedSwimlane')
  53. | {{_ 'activity-archived' swimlane.title}}.
  54. if($eq activityType 'createBoard')
  55. | {{_ 'activity-created' boardLabel}}.
  56. if($eq activityType 'createCard')
  57. | {{{_ 'activity-added' cardLink boardLabel}}}.
  58. if($eq activityType 'createCustomField')
  59. | {{_ 'activity-customfield-created' customField}}.
  60. if($eq activityType 'createList')
  61. | {{_ 'activity-added' list.title boardLabel}}.
  62. if($eq activityType 'createSwimlane')
  63. | {{_ 'activity-added' swimlane.title boardLabel}}.
  64. if($eq activityType 'removeList')
  65. | {{_ 'activity-removed' title boardLabel}}.
  66. if($eq activityType 'importBoard')
  67. | {{{_ 'activity-imported-board' boardLabel sourceLink}}}.
  68. if($eq activityType 'importCard')
  69. | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}.
  70. if($eq activityType 'importList')
  71. | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}.
  72. if($eq activityType 'joinMember')
  73. if($eq user._id member._id)
  74. | {{{_ 'activity-joined' cardLink}}}.
  75. else
  76. | {{{_ 'activity-added' memberLink cardLink}}}.
  77. if($eq activityType 'moveCardBoard')
  78. | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}.
  79. if($eq activityType 'moveCard')
  80. | {{{_ 'activity-moved' cardLink oldList.title list.title}}}.
  81. if($eq activityType 'removeBoardMember')
  82. | {{{_ 'activity-excluded' memberLink boardLabel}}}.
  83. if($eq activityType 'restoredCard')
  84. | {{{_ 'activity-sent' cardLink boardLabel}}}.
  85. if($eq activityType 'addedLabel')
  86. | {{{_ 'activity-added-label' lastLabel cardLink}}}.
  87. if($eq activityType 'removedLabel')
  88. | {{{_ 'activity-removed-label' lastLabel cardLink}}}.
  89. if($eq activityType 'setCustomField')
  90. | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}.
  91. if($eq activityType 'unsetCustomField')
  92. | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}.
  93. if($eq activityType 'unjoinMember')
  94. if($eq user._id member._id)
  95. | {{{_ 'activity-unjoined' cardLink}}}.
  96. else
  97. | {{{_ 'activity-removed' memberLink cardLink}}}.
  98. span(title=createdAt).activity-meta {{ moment createdAt }}
  99. template(name="cardActivities")
  100. each currentCard.activities
  101. .activity
  102. +userAvatar(userId=user._id)
  103. p.activity-desc
  104. +memberName(user=user)
  105. if($eq activityType 'createCard')
  106. | {{_ 'activity-added' cardLabel listName}}.
  107. if($eq activityType 'importCard')
  108. | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}.
  109. if($eq activityType 'joinMember')
  110. if($eq user._id member._id)
  111. | {{_ 'activity-joined' cardLabel}}.
  112. else
  113. | {{{_ 'activity-added' memberLink cardLabel}}}.
  114. if($eq activityType 'unjoinMember')
  115. if($eq user._id member._id)
  116. | {{_ 'activity-unjoined' cardLabel}}.
  117. else
  118. | {{{_ 'activity-removed' cardLabel memberLink}}}.
  119. if($eq activityType 'archivedCard')
  120. | {{_ 'activity-archived' cardLabel}}.
  121. if($eq activityType 'addedLabel')
  122. | {{{_ 'activity-added-label-card' lastLabel }}}.
  123. if($eq activityType 'removedLabel')
  124. | {{{_ 'activity-removed-label-card' lastLabel }}}.
  125. if($eq activityType 'removeChecklist')
  126. | {{{_ 'activity-checklist-removed' cardLabel}}}.
  127. if($eq activityType 'checkedItem')
  128. | {{{_ 'activity-checked-item-card' checkItem checklist.title }}}.
  129. if($eq activityType 'uncheckedItem')
  130. | {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}.
  131. if($eq activityType 'checklistCompleted')
  132. | {{{_ 'activity-checklist-completed-card' checklist.title }}}.
  133. if($eq activityType 'checklistUncompleted')
  134. | {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}.
  135. if($eq activityType 'restoredCard')
  136. | {{_ 'activity-sent' cardLabel boardLabel}}.
  137. if($eq activityType 'moveCard')
  138. | {{_ 'activity-moved' cardLabel oldList.title list.title}}.
  139. if($eq activityType 'moveCardBoard')
  140. | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}.
  141. if($eq activityType 'addAttachment')
  142. | {{{_ 'activity-attached' attachmentLink cardLabel}}}.
  143. if attachment.isImage
  144. img.attachment-image-preview(src=attachment.url)
  145. if($eq activityType 'deleteAttachment')
  146. | {{{_ 'activity-delete-attach' cardLabel}}}.
  147. if($eq activityType 'removedChecklist')
  148. | {{{_ 'activity-checklist-removed' cardLabel}}}.
  149. if($eq activityType 'addChecklist')
  150. | {{{_ 'activity-checklist-added' cardLabel}}}.
  151. .activity-checklist
  152. +viewer
  153. = checklist.title
  154. if($eq activityType 'addChecklistItem')
  155. | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
  156. .activity-checklist(href="{{ card.absoluteUrl }}")
  157. +viewer
  158. = checklistItem.title
  159. if(currentData.timeKey)
  160. | {{{_ activityType }}}
  161. = ' '
  162. i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }}
  163. if (currentData.timeOldValue)
  164. = ' '
  165. | {{{_ "previous_as" }}}
  166. = ' '
  167. i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }}
  168. = ' @'
  169. else if(currentData.timeValue)
  170. | {{{_ activityType currentData.timeValue}}}
  171. if($eq activityType 'deleteComment')
  172. | {{{_ 'activity-deleteComment' currentData.commentId}}}.
  173. if($eq activityType 'editComment')
  174. | {{{_ 'activity-editComment' currentData.commentId}}}.
  175. if($eq activityType 'addComment')
  176. +inlinedForm(classNames='js-edit-comment')
  177. +editor(autofocus=true)
  178. = comment.text
  179. .edit-controls
  180. button.primary(type="submit") {{_ 'edit'}}
  181. else
  182. .activity-comment
  183. +viewer
  184. = comment.text
  185. span(title=createdAt).activity-meta {{ moment createdAt }}
  186. if ($eq currentUser._id comment.userId)
  187. = ' - '
  188. a.js-open-inlined-form {{_ "edit"}}
  189. = ' - '
  190. a.js-delete-comment {{_ "delete"}}
  191. else
  192. span(title=createdAt).activity-meta {{ moment createdAt }}