activities.jade 5.4 KB

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