summaryrefslogtreecommitdiffstats
path: root/client/components/activities/activities.jade
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-12 13:59:39 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-12 17:48:15 +0200
commitc8945679872a0708eb67a477a99a65d508c84cb0 (patch)
tree5cf9f2cc842f891451f7bc247b5f0833c1ab39e7 /client/components/activities/activities.jade
parent216887490e3be0ba141484afc11d37475e91562d (diff)
downloadwekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.gz
wekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.bz2
wekan-c8945679872a0708eb67a477a99a65d508c84cb0.zip
Work on the card activities and comments
This commit also introduces a new CSSEvents object that is used to abstract vendor specifics events related to CSS transitions and animations. Fixes #183. Fixes #179.
Diffstat (limited to 'client/components/activities/activities.jade')
-rw-r--r--client/components/activities/activities.jade107
1 files changed, 106 insertions, 1 deletions
diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade
index 1c6b9faf..dd47af7f 100644
--- a/client/components/activities/activities.jade
+++ b/client/components/activities/activities.jade
@@ -1,8 +1,113 @@
template(name="activities")
- .js-sidebar-activities
+ .activities.js-sidebar-activities
//- We should use Template.dynamic here but there is a bug with
//- blaze-components: https://github.com/peerlibrary/meteor-blaze-components/issues/30
if $eq mode "board"
+boardActivities
else
+cardActivities
+
+template(name="boardActivities")
+ each currentBoard.activities
+ .activity
+ +userAvatar(userId=user._id)
+ p.activity-desc
+ +memberName(user=user)
+
+ if($eq activityType 'createBoard')
+ | {{_ 'activity-created' boardLabel}}.
+
+ if($eq activityType 'createList')
+ | {{_ 'activity-added' list.title boardLabel}}.
+
+ if($eq activityType 'archivedList')
+ | {{_ 'activity-archived' list.title}}.
+
+ if($eq activityType 'createCard')
+ | {{{_ 'activity-added' cardLink boardLabel}}}.
+
+ if($eq activityType 'archivedCard')
+ | {{{_ 'activity-archived' cardLink}}}.
+
+ if($eq activityType 'restoredCard')
+ | {{{_ 'activity-sent' cardLink boardLabel}}}.
+
+ if($eq activityType 'moveCard')
+ | {{{_ 'activity-moved' cardLink oldList.title list.title}}}.
+
+ if($eq activityType 'addBoardMember')
+ | {{{_ 'activity-added' memberLink boardLabel}}}.
+
+ if($eq activityType 'removeBoardMember')
+ | {{{_ 'activity-excluded' memberLink boardLabel}}}.
+
+ if($eq activityType 'joinMember')
+ if($eq currentUser._id member._id)
+ | {{{_ 'activity-joined' cardLink}}}.
+ else
+ | {{{_ 'activity-added' memberLink cardLink}}}.
+
+ if($eq activityType 'unjoinMember')
+ if($eq currentUser._id member._id)
+ | {{{_ 'activity-unjoined' cardLink}}}.
+ else
+ | {{{_ 'activity-removed' memberLink cardLink}}}.
+
+ if($eq activityType 'addComment')
+ | {{{_ 'activity-on' cardLink}}}
+ a.activity-comment(href="{{ card.absoluteUrl }}")
+ +viewer
+ = comment.text
+
+ if($eq activityType 'addAttachment')
+ | {{{_ 'activity-attached' attachmentLink cardLink}}}.
+
+ span.activity-meta {{ moment createdAt }}
+
+template(name="cardActivities")
+ each currentCard.activities
+ .activity
+ +userAvatar(userId=user._id)
+ p.activity-desc
+ +memberName(user=user)
+ if($eq activityType 'createCard')
+ | {{_ 'activity-added' cardLabel list.title}}.
+ if($eq activityType 'joinMember')
+ if($eq currentUser._id member._id)
+ | {{_ 'activity-joined' cardLabel}}.
+ else
+ | {{{_ 'activity-added' cardLabel memberLink}}}.
+ if($eq activityType 'unjoinMember')
+ if($eq currentUser._id member._id)
+ | {{_ 'activity-unjoined' cardLabel}}.
+ else
+ | {{{_ 'activity-removed' cardLabel memberLink}}}.
+ if($eq activityType 'archivedCard')
+ | {{_ 'activity-archived' cardLabel}}.
+ if($eq activityType 'restoredCard')
+ | {{_ 'activity-sent' cardLabel boardLabel}}.
+ if($eq activityType 'moveCard')
+ | {{_ 'activity-moved' cardLabel oldList.title list.title}}.
+ if($eq activityType 'addAttachment')
+ | {{{_ 'activity-attached' attachmentLink cardLabel}}}.
+ if attachment.isImage
+ img.attachment-image-preview(src=attachment.url)
+
+ if($eq activityType 'addComment')
+ +inlinedForm(classNames='js-edit-comment')
+ +editor(autofocus=true)
+ = comment.text
+ .edit-controls
+ button.primary(type="submit") {{_ 'edit'}}
+ else
+ .activity-comment
+ +viewer
+ = comment.text
+ span.activity-meta
+ | {{ moment createdAt }} -
+ a.js-open-inlined-form {{_ "edit"}}
+ = ' - '
+ a.js-delete-comment {{_ "delete"}}
+
+ else
+ span.activity-meta {{ moment createdAt }}