activities.jade 4.9 KB

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