activities.jade 5.7 KB

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