activities.jade 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 'addAttachment')
  16. | {{{_ 'activity-attached' attachmentLink cardLink}}}.
  17. if($eq activityType 'addBoardMember')
  18. | {{{_ 'activity-added' memberLink boardLabel}}}.
  19. if($eq activityType 'addComment')
  20. | {{{_ 'activity-on' cardLink}}}
  21. a.activity-comment(href="{{ card.absoluteUrl }}")
  22. +viewer
  23. = comment.text
  24. if($eq activityType 'addChecklist')
  25. | {{{_ 'activity-checklist-added' cardLink}}}.
  26. .activity-checklist(href="{{ card.absoluteUrl }}")
  27. +viewer
  28. = checklist.title
  29. if($eq activityType 'addChecklistItem')
  30. | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
  31. .activity-checklist(href="{{ card.absoluteUrl }}")
  32. +viewer
  33. = checklistItem.title
  34. if($eq activityType 'archivedCard')
  35. | {{{_ 'activity-archived' cardLink}}}.
  36. if($eq activityType 'archivedList')
  37. | {{_ 'activity-archived' list.title}}.
  38. if($eq activityType 'archivedSwimlane')
  39. | {{_ 'activity-archived' swimlane.title}}.
  40. if($eq activityType 'createBoard')
  41. | {{_ 'activity-created' boardLabel}}.
  42. if($eq activityType 'createCard')
  43. | {{{_ 'activity-added' cardLink boardLabel}}}.
  44. if($eq activityType 'createList')
  45. | {{_ 'activity-added' list.title boardLabel}}.
  46. if($eq activityType 'createSwimlane')
  47. | {{_ 'activity-added' swimlane.title boardLabel}}.
  48. if($eq activityType 'removeList')
  49. | {{_ 'activity-removed' title boardLabel}}.
  50. if($eq activityType 'importBoard')
  51. | {{{_ 'activity-imported-board' boardLabel sourceLink}}}.
  52. if($eq activityType 'importCard')
  53. | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}.
  54. if($eq activityType 'importList')
  55. | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}.
  56. if($eq activityType 'joinMember')
  57. if($eq user._id member._id)
  58. | {{{_ 'activity-joined' cardLink}}}.
  59. else
  60. | {{{_ 'activity-added' memberLink cardLink}}}.
  61. if($eq activityType 'moveCard')
  62. | {{{_ 'activity-moved' cardLink oldList.title list.title}}}.
  63. if($eq activityType 'removeBoardMember')
  64. | {{{_ 'activity-excluded' memberLink boardLabel}}}.
  65. if($eq activityType 'restoredCard')
  66. | {{{_ 'activity-sent' cardLink boardLabel}}}.
  67. if($eq activityType 'unjoinMember')
  68. if($eq user._id member._id)
  69. | {{{_ 'activity-unjoined' cardLink}}}.
  70. else
  71. | {{{_ 'activity-removed' memberLink cardLink}}}.
  72. span(title=createdAt).activity-meta {{ moment createdAt }}
  73. template(name="cardActivities")
  74. each currentCard.activities
  75. .activity
  76. +userAvatar(userId=user._id)
  77. p.activity-desc
  78. +memberName(user=user)
  79. if($eq activityType 'createCard')
  80. | {{_ 'activity-added' cardLabel list.title}}.
  81. if($eq activityType 'importCard')
  82. | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}.
  83. if($eq activityType 'joinMember')
  84. if($eq user._id member._id)
  85. | {{_ 'activity-joined' cardLabel}}.
  86. else
  87. | {{{_ 'activity-added' memberLink cardLabel}}}.
  88. if($eq activityType 'unjoinMember')
  89. if($eq user._id member._id)
  90. | {{_ 'activity-unjoined' cardLabel}}.
  91. else
  92. | {{{_ 'activity-removed' cardLabel memberLink}}}.
  93. if($eq activityType 'archivedCard')
  94. | {{_ 'activity-archived' cardLabel}}.
  95. if($eq activityType 'restoredCard')
  96. | {{_ 'activity-sent' cardLabel boardLabel}}.
  97. if($eq activityType 'moveCard')
  98. | {{_ 'activity-moved' cardLabel oldList.title list.title}}.
  99. if($eq activityType 'addAttachment')
  100. | {{{_ 'activity-attached' attachmentLink cardLabel}}}.
  101. if attachment.isImage
  102. img.attachment-image-preview(src=attachment.url)
  103. if($eq activityType 'addChecklist')
  104. | {{{_ 'activity-checklist-added' cardLabel}}}.
  105. .activity-checklist
  106. +viewer
  107. = checklist.title
  108. if($eq activityType 'addChecklistItem')
  109. | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
  110. .activity-checklist(href="{{ card.absoluteUrl }}")
  111. +viewer
  112. = checklistItem.title
  113. if($eq activityType 'addComment')
  114. +inlinedForm(classNames='js-edit-comment')
  115. +editor(autofocus=true)
  116. = comment.text
  117. .edit-controls
  118. button.primary(type="submit") {{_ 'edit'}}
  119. else
  120. .activity-comment
  121. +viewer
  122. = comment.text
  123. span(title=createdAt).activity-meta {{ moment createdAt }}
  124. if ($eq currentUser._id comment.userId)
  125. = ' - '
  126. a.js-open-inlined-form {{_ "edit"}}
  127. = ' - '
  128. a.js-delete-comment {{_ "delete"}}
  129. else
  130. span(title=createdAt).activity-meta {{ moment createdAt }}