activities.jade 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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 'moveCard')
  78. | {{{_ 'activity-moved' cardLink oldList.title list.title}}}.
  79. if($eq activityType 'removeBoardMember')
  80. | {{{_ 'activity-excluded' memberLink boardLabel}}}.
  81. if($eq activityType 'restoredCard')
  82. | {{{_ 'activity-sent' cardLink boardLabel}}}.
  83. if($eq activityType 'addedLabel')
  84. | {{{_ 'activity-added-label' lastLabel cardLink}}}.
  85. if($eq activityType 'removedLabel')
  86. | {{{_ 'activity-removed-label' lastLabel cardLink}}}.
  87. if($eq activityType 'unjoinMember')
  88. if($eq user._id member._id)
  89. | {{{_ 'activity-unjoined' cardLink}}}.
  90. else
  91. | {{{_ 'activity-removed' memberLink cardLink}}}.
  92. span(title=createdAt).activity-meta {{ moment createdAt }}
  93. template(name="cardActivities")
  94. each currentCard.activities
  95. .activity
  96. +userAvatar(userId=user._id)
  97. p.activity-desc
  98. +memberName(user=user)
  99. if($eq activityType 'createCard')
  100. | {{_ 'activity-added' cardLabel list.title}}.
  101. if($eq activityType 'importCard')
  102. | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}.
  103. if($eq activityType 'joinMember')
  104. if($eq user._id member._id)
  105. | {{_ 'activity-joined' cardLabel}}.
  106. else
  107. | {{{_ 'activity-added' memberLink cardLabel}}}.
  108. if($eq activityType 'unjoinMember')
  109. if($eq user._id member._id)
  110. | {{_ 'activity-unjoined' cardLabel}}.
  111. else
  112. | {{{_ 'activity-removed' cardLabel memberLink}}}.
  113. if($eq activityType 'archivedCard')
  114. | {{_ 'activity-archived' cardLabel}}.
  115. if($eq activityType 'addedLabel')
  116. | {{{_ 'activity-added-label-card' lastLabel }}}.
  117. if($eq activityType 'removedLabel')
  118. | {{{_ 'activity-removed-label-card' lastLabel }}}.
  119. if($eq activityType 'removeChecklist')
  120. | {{{_ 'activity-checklist-removed' cardLabel}}}.
  121. if($eq activityType 'checkedItem')
  122. | {{{_ 'activity-checked-item-card' checkItem checklist.title }}}.
  123. if($eq activityType 'uncheckedItem')
  124. | {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}.
  125. if($eq activityType 'checklistCompleted')
  126. | {{{_ 'activity-checklist-completed-card' checklist.title }}}.
  127. if($eq activityType 'checklistUncompleted')
  128. | {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}.
  129. if($eq activityType 'restoredCard')
  130. | {{_ 'activity-sent' cardLabel boardLabel}}.
  131. if($eq activityType 'moveCard')
  132. | {{_ 'activity-moved' cardLabel oldList.title list.title}}.
  133. if($eq activityType 'addAttachment')
  134. | {{{_ 'activity-attached' attachmentLink cardLabel}}}.
  135. if attachment.isImage
  136. img.attachment-image-preview(src=attachment.url)
  137. if($eq activityType 'deleteAttachment')
  138. | {{{_ 'activity-delete-attach' cardLabel}}}.
  139. if($eq activityType 'removedChecklist')
  140. | {{{_ 'activity-checklist-removed' cardLabel}}}.
  141. if($eq activityType 'addChecklist')
  142. | {{{_ 'activity-checklist-added' cardLabel}}}.
  143. .activity-checklist
  144. +viewer
  145. = checklist.title
  146. if($eq activityType 'addChecklistItem')
  147. | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
  148. .activity-checklist(href="{{ card.absoluteUrl }}")
  149. +viewer
  150. = checklistItem.title
  151. if($eq activityType 'addComment')
  152. +inlinedForm(classNames='js-edit-comment')
  153. +editor(autofocus=true)
  154. = comment.text
  155. .edit-controls
  156. button.primary(type="submit") {{_ 'edit'}}
  157. else
  158. .activity-comment
  159. +viewer
  160. = comment.text
  161. span(title=createdAt).activity-meta {{ moment createdAt }}
  162. if ($eq currentUser._id comment.userId)
  163. = ' - '
  164. a.js-open-inlined-form {{_ "edit"}}
  165. = ' - '
  166. a.js-delete-comment {{_ "delete"}}
  167. else
  168. span(title=createdAt).activity-meta {{ moment createdAt }}