activities.jade 5.5 KB

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