activities.jade 4.8 KB

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