activities.jade 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 'createBoard')
  16. | {{_ 'activity-created' boardLabel}}.
  17. if($eq activityType 'createList')
  18. | {{_ 'activity-added' list.title boardLabel}}.
  19. if($eq activityType 'archivedList')
  20. | {{_ 'activity-archived' list.title}}.
  21. if($eq activityType 'createCard')
  22. | {{{_ 'activity-added' cardLink boardLabel}}}.
  23. if($eq activityType 'importCard')
  24. | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}.
  25. if($eq activityType 'archivedCard')
  26. | {{{_ 'activity-archived' cardLink}}}.
  27. if($eq activityType 'restoredCard')
  28. | {{{_ 'activity-sent' cardLink boardLabel}}}.
  29. if($eq activityType 'moveCard')
  30. | {{{_ 'activity-moved' cardLink oldList.title list.title}}}.
  31. if($eq activityType 'addBoardMember')
  32. | {{{_ 'activity-added' memberLink boardLabel}}}.
  33. if($eq activityType 'removeBoardMember')
  34. | {{{_ 'activity-excluded' memberLink boardLabel}}}.
  35. if($eq activityType 'joinMember')
  36. if($eq currentUser._id member._id)
  37. | {{{_ 'activity-joined' cardLink}}}.
  38. else
  39. | {{{_ 'activity-added' memberLink cardLink}}}.
  40. if($eq activityType 'unjoinMember')
  41. if($eq currentUser._id member._id)
  42. | {{{_ 'activity-unjoined' cardLink}}}.
  43. else
  44. | {{{_ 'activity-removed' memberLink cardLink}}}.
  45. if($eq activityType 'addComment')
  46. | {{{_ 'activity-on' cardLink}}}
  47. a.activity-comment(href="{{ card.absoluteUrl }}")
  48. +viewer
  49. = comment.text
  50. if($eq activityType 'addAttachment')
  51. | {{{_ 'activity-attached' attachmentLink cardLink}}}.
  52. span.activity-meta {{ moment createdAt }}
  53. template(name="cardActivities")
  54. each currentCard.activities
  55. .activity
  56. +userAvatar(userId=user._id)
  57. p.activity-desc
  58. +memberName(user=user)
  59. if($eq activityType 'createCard')
  60. | {{_ 'activity-added' cardLabel list.title}}.
  61. if($eq activityType 'importCard')
  62. | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}.
  63. if($eq activityType 'joinMember')
  64. if($eq currentUser._id member._id)
  65. | {{_ 'activity-joined' cardLabel}}.
  66. else
  67. | {{{_ 'activity-added' cardLabel memberLink}}}.
  68. if($eq activityType 'unjoinMember')
  69. if($eq currentUser._id member._id)
  70. | {{_ 'activity-unjoined' cardLabel}}.
  71. else
  72. | {{{_ 'activity-removed' cardLabel memberLink}}}.
  73. if($eq activityType 'archivedCard')
  74. | {{_ 'activity-archived' cardLabel}}.
  75. if($eq activityType 'restoredCard')
  76. | {{_ 'activity-sent' cardLabel boardLabel}}.
  77. if($eq activityType 'moveCard')
  78. | {{_ 'activity-moved' cardLabel oldList.title list.title}}.
  79. if($eq activityType 'addAttachment')
  80. | {{{_ 'activity-attached' attachmentLink cardLabel}}}.
  81. if attachment.isImage
  82. img.attachment-image-preview(src=attachment.url)
  83. if($eq activityType 'addComment')
  84. +inlinedForm(classNames='js-edit-comment')
  85. +editor(autofocus=true)
  86. = comment.text
  87. .edit-controls
  88. button.primary(type="submit") {{_ 'edit'}}
  89. else
  90. .activity-comment
  91. +viewer
  92. = comment.text
  93. span.activity-meta {{ moment createdAt }}
  94. if ($eq currentUser._id comment.userId)
  95. = ' - '
  96. a.js-open-inlined-form {{_ "edit"}}
  97. = ' - '
  98. a.js-delete-comment {{_ "delete"}}
  99. else
  100. span.activity-meta {{ moment createdAt }}