activities.jade 4.0 KB

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