activities.jade 4.4 KB

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