From f22785dbcde42e425c9ead209ec224aef6e11c16 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 5 Feb 2020 19:47:08 +0200 Subject: - Fix adding comments. - Added some working layout changes from https://github.com/wekan/wekan/pull/2920. - Fixed Card Settings not working at Sandstorm. Thanks to 2020product xet7 ! Closes #2918, closes https://github.com/wekan/wekan/pull/2920 --- client/components/activities/activities.styl | 2 +- client/components/activities/comments.styl | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'client/components/activities') diff --git a/client/components/activities/activities.styl b/client/components/activities/activities.styl index 380e7b40..f3b1acdd 100644 --- a/client/components/activities/activities.styl +++ b/client/components/activities/activities.styl @@ -9,7 +9,7 @@ clear: both .activity - margin: 10px 0 + margin: 0.5px 0 display: flex .member diff --git a/client/components/activities/comments.styl b/client/components/activities/comments.styl index 22f9c482..ccf24b72 100644 --- a/client/components/activities/comments.styl +++ b/client/components/activities/comments.styl @@ -46,3 +46,23 @@ &:is-open cursor: auto + +.comment-item + background-color: #fff + border: 0 + box-shadow: 0 1px 2px rgba(0, 0, 0, .23) + color: #8c8c8c + height: 36px + margin: 4px 4px 6px 0 + width: 92% + + &:hover + background: darken(white, 12%) + + &.add-comment + display: flex + margin: 5px + + a + display: block + margin: auto -- cgit v1.2.3-1-g7c22 From 2fce02afbced07c6ff2b05786f159701c8b559e9 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 7 Feb 2020 13:58:43 +0200 Subject: Add Feature: Card Settings/Show on card/Activities. Fix: When in Card Settings hiding Comments, only adding new comment is hidden, not old comments. Thanks to xet7 ! Closes #2925 --- client/components/activities/activities.jade | 388 ++++++++++++++------------- 1 file changed, 195 insertions(+), 193 deletions(-) (limited to 'client/components/activities') diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade index deb73072..d7eff885 100644 --- a/client/components/activities/activities.jade +++ b/client/components/activities/activities.jade @@ -8,234 +8,236 @@ template(name="activities") +cardActivities template(name="boardActivities") - each currentBoard.activities - .activity - +userAvatar(userId=user._id) - p.activity-desc - +memberName(user=user) + if currentBoard.allowsActivities + each currentBoard.activities + .activity + +userAvatar(userId=user._id) + p.activity-desc + +memberName(user=user) - if($eq activityType 'deleteAttachment') - | {{{_ 'activity-delete-attach' cardLink}}}. + if($eq activityType 'deleteAttachment') + | {{{_ 'activity-delete-attach' cardLink}}}. - if($eq activityType 'addAttachment') - | {{{_ 'activity-attached' attachmentLink cardLink}}}. + if($eq activityType 'addAttachment') + | {{{_ 'activity-attached' attachmentLink cardLink}}}. - if($eq activityType 'addBoardMember') - | {{{_ 'activity-added' memberLink boardLabel}}}. + if($eq activityType 'addBoardMember') + | {{{_ 'activity-added' memberLink boardLabel}}}. - if($eq activityType 'addComment') - | {{{_ 'activity-on' cardLink}}} - a.activity-comment(href="{{ card.absoluteUrl }}") - +viewer - = comment.text + if($eq activityType 'addComment') + | {{{_ 'activity-on' cardLink}}} + a.activity-comment(href="{{ card.absoluteUrl }}") + +viewer + = comment.text - if($eq activityType 'addChecklist') - | {{{_ 'activity-checklist-added' cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklist.title - if($eq activityType 'removeChecklist') - | {{{_ 'activity-checklist-removed' cardLink}}}. + if($eq activityType 'addChecklist') + | {{{_ 'activity-checklist-added' cardLink}}}. + .activity-checklist(href="{{ card.absoluteUrl }}") + +viewer + = checklist.title + if($eq activityType 'removeChecklist') + | {{{_ 'activity-checklist-removed' cardLink}}}. - if($eq activityType 'checkedItem') - | {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}. + if($eq activityType 'checkedItem') + | {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}. - if($eq activityType 'uncheckedItem') - | {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}. + if($eq activityType 'uncheckedItem') + | {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}. - if($eq activityType 'checklistCompleted') - | {{{_ 'activity-checklist-completed' checklist.title cardLink}}}. + if($eq activityType 'checklistCompleted') + | {{{_ 'activity-checklist-completed' checklist.title cardLink}}}. - if($eq activityType 'checklistUncompleted') - | {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}. + if($eq activityType 'checklistUncompleted') + | {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}. - if($eq activityType 'addChecklistItem') - | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklistItem.title - if($eq activityType 'removedChecklistItem') - | {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}. + if($eq activityType 'addChecklistItem') + | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. + .activity-checklist(href="{{ card.absoluteUrl }}") + +viewer + = checklistItem.title + if($eq activityType 'removedChecklistItem') + | {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}. - if($eq activityType 'archivedCard') - | {{{_ 'activity-archived' cardLink}}}. + if($eq activityType 'archivedCard') + | {{{_ 'activity-archived' cardLink}}}. - if($eq activityType 'archivedList') - | {{_ 'activity-archived' list.title}}. + if($eq activityType 'archivedList') + | {{_ 'activity-archived' list.title}}. - if($eq activityType 'archivedSwimlane') - | {{_ 'activity-archived' swimlane.title}}. + if($eq activityType 'archivedSwimlane') + | {{_ 'activity-archived' swimlane.title}}. - if($eq activityType 'createBoard') - | {{_ 'activity-created' boardLabel}}. + if($eq activityType 'createBoard') + | {{_ 'activity-created' boardLabel}}. - if($eq activityType 'createCard') - | {{{_ 'activity-added' cardLink boardLabel}}}. + if($eq activityType 'createCard') + | {{{_ 'activity-added' cardLink boardLabel}}}. - if($eq activityType 'createCustomField') - | {{_ 'activity-customfield-created' customField}}. + if($eq activityType 'createCustomField') + | {{_ 'activity-customfield-created' customField}}. - if($eq activityType 'createList') - | {{_ 'activity-added' list.title boardLabel}}. + if($eq activityType 'createList') + | {{_ 'activity-added' list.title boardLabel}}. - if($eq activityType 'createSwimlane') - | {{_ 'activity-added' swimlane.title boardLabel}}. + if($eq activityType 'createSwimlane') + | {{_ 'activity-added' swimlane.title boardLabel}}. - if($eq activityType 'removeList') - | {{_ 'activity-removed' title boardLabel}}. + if($eq activityType 'removeList') + | {{_ 'activity-removed' title boardLabel}}. - if($eq activityType 'importBoard') - | {{{_ 'activity-imported-board' boardLabel sourceLink}}}. + if($eq activityType 'importBoard') + | {{{_ 'activity-imported-board' boardLabel sourceLink}}}. - if($eq activityType 'importCard') - | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}. + if($eq activityType 'importCard') + | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}. - if($eq activityType 'importList') - | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}. + if($eq activityType 'importList') + | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}. - if($eq activityType 'joinMember') - if($eq user._id member._id) - | {{{_ 'activity-joined' cardLink}}}. - else - | {{{_ 'activity-added' memberLink cardLink}}}. + if($eq activityType 'joinMember') + if($eq user._id member._id) + | {{{_ 'activity-joined' cardLink}}}. + else + | {{{_ 'activity-added' memberLink cardLink}}}. - if($eq activityType 'moveCardBoard') - | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. + if($eq activityType 'moveCardBoard') + | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. - if($eq activityType 'moveCard') - | {{{_ 'activity-moved' cardLink oldList.title list.title}}}. + if($eq activityType 'moveCard') + | {{{_ 'activity-moved' cardLink oldList.title list.title}}}. - if($eq activityType 'removeBoardMember') - | {{{_ 'activity-excluded' memberLink boardLabel}}}. + if($eq activityType 'removeBoardMember') + | {{{_ 'activity-excluded' memberLink boardLabel}}}. - if($eq activityType 'restoredCard') - | {{{_ 'activity-sent' cardLink boardLabel}}}. + if($eq activityType 'restoredCard') + | {{{_ 'activity-sent' cardLink boardLabel}}}. - if($eq activityType 'addedLabel') - | {{{_ 'activity-added-label' lastLabel cardLink}}}. + if($eq activityType 'addedLabel') + | {{{_ 'activity-added-label' lastLabel cardLink}}}. - if($eq activityType 'removedLabel') - | {{{_ 'activity-removed-label' lastLabel cardLink}}}. + if($eq activityType 'removedLabel') + | {{{_ 'activity-removed-label' lastLabel cardLink}}}. - if($eq activityType 'setCustomField') - | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}. + if($eq activityType 'setCustomField') + | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}. - if($eq activityType 'unsetCustomField') - | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}. + if($eq activityType 'unsetCustomField') + | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}. - if($eq activityType 'unjoinMember') - if($eq user._id member._id) - | {{{_ 'activity-unjoined' cardLink}}}. - else - | {{{_ 'activity-removed' memberLink cardLink}}}. + if($eq activityType 'unjoinMember') + if($eq user._id member._id) + | {{{_ 'activity-unjoined' cardLink}}}. + else + | {{{_ 'activity-removed' memberLink cardLink}}}. - span(title=createdAt).activity-meta {{ moment createdAt }} + span(title=createdAt).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 listName}}. - if($eq activityType 'importCard') - | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}. - if($eq activityType 'joinMember') - if($eq user._id member._id) - | {{_ 'activity-joined' cardLabel}}. - else - | {{{_ 'activity-added' memberLink cardLabel}}}. - if($eq activityType 'unjoinMember') - if($eq user._id member._id) - | {{_ 'activity-unjoined' cardLabel}}. - else - | {{{_ 'activity-removed' cardLabel memberLink}}}. - if($eq activityType 'archivedCard') - | {{_ 'activity-archived' cardLabel}}. - - if($eq activityType 'addedLabel') - | {{{_ 'activity-added-label-card' lastLabel }}}. - - if($eq activityType 'removedLabel') - | {{{_ 'activity-removed-label-card' lastLabel }}}. - - if($eq activityType 'removeChecklist') - | {{{_ 'activity-checklist-removed' cardLabel}}}. - - if($eq activityType 'checkedItem') - | {{{_ 'activity-checked-item-card' checkItem checklist.title }}}. - - if($eq activityType 'uncheckedItem') - | {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}. - - if($eq activityType 'checklistCompleted') - | {{{_ 'activity-checklist-completed-card' checklist.title }}}. - - if($eq activityType 'checklistUncompleted') - | {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}. - - if($eq activityType 'restoredCard') - | {{_ 'activity-sent' cardLabel boardLabel}}. - if($eq activityType 'moveCard') - | {{_ 'activity-moved' cardLabel oldList.title list.title}}. - - if($eq activityType 'moveCardBoard') - | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. - - if($eq activityType 'addAttachment') - | {{{_ 'activity-attached' attachmentLink cardLabel}}}. - if attachment.isImage - img.attachment-image-preview(src=attachment.url) - if($eq activityType 'deleteAttachment') - | {{{_ 'activity-delete-attach' cardLabel}}}. - if($eq activityType 'removedChecklist') - | {{{_ 'activity-checklist-removed' cardLabel}}}. - if($eq activityType 'addChecklist') - | {{{_ 'activity-checklist-added' cardLabel}}}. - .activity-checklist - +viewer - = checklist.title - if($eq activityType 'addChecklistItem') - | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklistItem.title - - if(currentData.timeKey) - | {{{_ activityType }}} - = ' ' - i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }} - if (currentData.timeOldValue) - = ' ' - | {{{_ "previous_as" }}} - = ' ' - i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }} - = ' @' - else if(currentData.timeValue) - | {{{_ activityType currentData.timeValue}}} - - - if($eq activityType 'deleteComment') - | {{{_ 'activity-deleteComment' currentData.commentId}}}. - if($eq activityType 'editComment') - | {{{_ 'activity-editComment' currentData.commentId}}}. - if($eq activityType 'addComment') - +inlinedForm(classNames='js-edit-comment') - +editor(autofocus=true) - = comment.text - .edit-controls - button.primary(type="submit") {{_ 'edit'}} - else - .activity-comment + if currentBoard.allowsComments + each currentCard.activities + .activity + +userAvatar(userId=user._id) + p.activity-desc + +memberName(user=user) + if($eq activityType 'createCard') + | {{_ 'activity-added' cardLabel listName}}. + if($eq activityType 'importCard') + | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}. + if($eq activityType 'joinMember') + if($eq user._id member._id) + | {{_ 'activity-joined' cardLabel}}. + else + | {{{_ 'activity-added' memberLink cardLabel}}}. + if($eq activityType 'unjoinMember') + if($eq user._id member._id) + | {{_ 'activity-unjoined' cardLabel}}. + else + | {{{_ 'activity-removed' cardLabel memberLink}}}. + if($eq activityType 'archivedCard') + | {{_ 'activity-archived' cardLabel}}. + + if($eq activityType 'addedLabel') + | {{{_ 'activity-added-label-card' lastLabel }}}. + + if($eq activityType 'removedLabel') + | {{{_ 'activity-removed-label-card' lastLabel }}}. + + if($eq activityType 'removeChecklist') + | {{{_ 'activity-checklist-removed' cardLabel}}}. + + if($eq activityType 'checkedItem') + | {{{_ 'activity-checked-item-card' checkItem checklist.title }}}. + + if($eq activityType 'uncheckedItem') + | {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}. + + if($eq activityType 'checklistCompleted') + | {{{_ 'activity-checklist-completed-card' checklist.title }}}. + + if($eq activityType 'checklistUncompleted') + | {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}. + + if($eq activityType 'restoredCard') + | {{_ 'activity-sent' cardLabel boardLabel}}. + if($eq activityType 'moveCard') + | {{_ 'activity-moved' cardLabel oldList.title list.title}}. + + if($eq activityType 'moveCardBoard') + | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. + + if($eq activityType 'addAttachment') + | {{{_ 'activity-attached' attachmentLink cardLabel}}}. + if attachment.isImage + img.attachment-image-preview(src=attachment.url) + if($eq activityType 'deleteAttachment') + | {{{_ 'activity-delete-attach' cardLabel}}}. + if($eq activityType 'removedChecklist') + | {{{_ 'activity-checklist-removed' cardLabel}}}. + if($eq activityType 'addChecklist') + | {{{_ 'activity-checklist-added' cardLabel}}}. + .activity-checklist +viewer + = checklist.title + if($eq activityType 'addChecklistItem') + | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. + .activity-checklist(href="{{ card.absoluteUrl }}") + +viewer + = checklistItem.title + + if(currentData.timeKey) + | {{{_ activityType }}} + = ' ' + i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }} + if (currentData.timeOldValue) + = ' ' + | {{{_ "previous_as" }}} + = ' ' + i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }} + = ' @' + else if(currentData.timeValue) + | {{{_ activityType currentData.timeValue}}} + + + if($eq activityType 'deleteComment') + | {{{_ 'activity-deleteComment' currentData.commentId}}}. + if($eq activityType 'editComment') + | {{{_ 'activity-editComment' currentData.commentId}}}. + if($eq activityType 'addComment') + +inlinedForm(classNames='js-edit-comment') + +editor(autofocus=true) = comment.text - span(title=createdAt).activity-meta {{ moment createdAt }} - if ($eq currentUser._id comment.userId) - = ' - ' - a.js-open-inlined-form {{_ "edit"}} - = ' - ' - a.js-delete-comment {{_ "delete"}} + .edit-controls + button.primary(type="submit") {{_ 'edit'}} + else + .activity-comment + +viewer + = comment.text + span(title=createdAt).activity-meta {{ moment createdAt }} + if ($eq currentUser._id comment.userId) + = ' - ' + a.js-open-inlined-form {{_ "edit"}} + = ' - ' + a.js-delete-comment {{_ "delete"}} - else - span(title=createdAt).activity-meta {{ moment createdAt }} + else + span(title=createdAt).activity-meta {{ moment createdAt }} -- cgit v1.2.3-1-g7c22 From 2a54218f3f68547032bd53a04a968b233be21e15 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 10 Feb 2020 17:25:27 +0200 Subject: Remove hiding comments and activities. --- client/components/activities/activities.jade | 388 +++++++++++++-------------- 1 file changed, 193 insertions(+), 195 deletions(-) (limited to 'client/components/activities') diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade index d7eff885..8ecbdee8 100644 --- a/client/components/activities/activities.jade +++ b/client/components/activities/activities.jade @@ -8,236 +8,234 @@ template(name="activities") +cardActivities template(name="boardActivities") - if currentBoard.allowsActivities - each currentBoard.activities - .activity - +userAvatar(userId=user._id) - p.activity-desc - +memberName(user=user) + each currentBoard.activities + .activity + +userAvatar(userId=user._id) + p.activity-desc + +memberName(user=user) - if($eq activityType 'deleteAttachment') - | {{{_ 'activity-delete-attach' cardLink}}}. + if($eq activityType 'deleteAttachment') + | {{{_ 'activity-delete-attach' cardLink}}}. - if($eq activityType 'addAttachment') - | {{{_ 'activity-attached' attachmentLink cardLink}}}. + if($eq activityType 'addAttachment') + | {{{_ 'activity-attached' attachmentLink cardLink}}}. - if($eq activityType 'addBoardMember') - | {{{_ 'activity-added' memberLink boardLabel}}}. + if($eq activityType 'addBoardMember') + | {{{_ 'activity-added' memberLink boardLabel}}}. - if($eq activityType 'addComment') - | {{{_ 'activity-on' cardLink}}} - a.activity-comment(href="{{ card.absoluteUrl }}") - +viewer - = comment.text + if($eq activityType 'addComment') + | {{{_ 'activity-on' cardLink}}} + a.activity-comment(href="{{ card.absoluteUrl }}") + +viewer + = comment.text - if($eq activityType 'addChecklist') - | {{{_ 'activity-checklist-added' cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklist.title - if($eq activityType 'removeChecklist') - | {{{_ 'activity-checklist-removed' cardLink}}}. + if($eq activityType 'addChecklist') + | {{{_ 'activity-checklist-added' cardLink}}}. + .activity-checklist(href="{{ card.absoluteUrl }}") + +viewer + = checklist.title + if($eq activityType 'removeChecklist') + | {{{_ 'activity-checklist-removed' cardLink}}}. - if($eq activityType 'checkedItem') - | {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}. + if($eq activityType 'checkedItem') + | {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}. - if($eq activityType 'uncheckedItem') - | {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}. + if($eq activityType 'uncheckedItem') + | {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}. - if($eq activityType 'checklistCompleted') - | {{{_ 'activity-checklist-completed' checklist.title cardLink}}}. + if($eq activityType 'checklistCompleted') + | {{{_ 'activity-checklist-completed' checklist.title cardLink}}}. - if($eq activityType 'checklistUncompleted') - | {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}. + if($eq activityType 'checklistUncompleted') + | {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}. - if($eq activityType 'addChecklistItem') - | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklistItem.title - if($eq activityType 'removedChecklistItem') - | {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}. + if($eq activityType 'addChecklistItem') + | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. + .activity-checklist(href="{{ card.absoluteUrl }}") + +viewer + = checklistItem.title + if($eq activityType 'removedChecklistItem') + | {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}. - if($eq activityType 'archivedCard') - | {{{_ 'activity-archived' cardLink}}}. + if($eq activityType 'archivedCard') + | {{{_ 'activity-archived' cardLink}}}. - if($eq activityType 'archivedList') - | {{_ 'activity-archived' list.title}}. + if($eq activityType 'archivedList') + | {{_ 'activity-archived' list.title}}. - if($eq activityType 'archivedSwimlane') - | {{_ 'activity-archived' swimlane.title}}. + if($eq activityType 'archivedSwimlane') + | {{_ 'activity-archived' swimlane.title}}. - if($eq activityType 'createBoard') - | {{_ 'activity-created' boardLabel}}. + if($eq activityType 'createBoard') + | {{_ 'activity-created' boardLabel}}. - if($eq activityType 'createCard') - | {{{_ 'activity-added' cardLink boardLabel}}}. + if($eq activityType 'createCard') + | {{{_ 'activity-added' cardLink boardLabel}}}. - if($eq activityType 'createCustomField') - | {{_ 'activity-customfield-created' customField}}. + if($eq activityType 'createCustomField') + | {{_ 'activity-customfield-created' customField}}. - if($eq activityType 'createList') - | {{_ 'activity-added' list.title boardLabel}}. + if($eq activityType 'createList') + | {{_ 'activity-added' list.title boardLabel}}. - if($eq activityType 'createSwimlane') - | {{_ 'activity-added' swimlane.title boardLabel}}. + if($eq activityType 'createSwimlane') + | {{_ 'activity-added' swimlane.title boardLabel}}. - if($eq activityType 'removeList') - | {{_ 'activity-removed' title boardLabel}}. + if($eq activityType 'removeList') + | {{_ 'activity-removed' title boardLabel}}. - if($eq activityType 'importBoard') - | {{{_ 'activity-imported-board' boardLabel sourceLink}}}. + if($eq activityType 'importBoard') + | {{{_ 'activity-imported-board' boardLabel sourceLink}}}. - if($eq activityType 'importCard') - | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}. + if($eq activityType 'importCard') + | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}. - if($eq activityType 'importList') - | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}. + if($eq activityType 'importList') + | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}. - if($eq activityType 'joinMember') - if($eq user._id member._id) - | {{{_ 'activity-joined' cardLink}}}. - else - | {{{_ 'activity-added' memberLink cardLink}}}. + if($eq activityType 'joinMember') + if($eq user._id member._id) + | {{{_ 'activity-joined' cardLink}}}. + else + | {{{_ 'activity-added' memberLink cardLink}}}. - if($eq activityType 'moveCardBoard') - | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. + if($eq activityType 'moveCardBoard') + | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. - if($eq activityType 'moveCard') - | {{{_ 'activity-moved' cardLink oldList.title list.title}}}. + if($eq activityType 'moveCard') + | {{{_ 'activity-moved' cardLink oldList.title list.title}}}. - if($eq activityType 'removeBoardMember') - | {{{_ 'activity-excluded' memberLink boardLabel}}}. + if($eq activityType 'removeBoardMember') + | {{{_ 'activity-excluded' memberLink boardLabel}}}. - if($eq activityType 'restoredCard') - | {{{_ 'activity-sent' cardLink boardLabel}}}. + if($eq activityType 'restoredCard') + | {{{_ 'activity-sent' cardLink boardLabel}}}. - if($eq activityType 'addedLabel') - | {{{_ 'activity-added-label' lastLabel cardLink}}}. + if($eq activityType 'addedLabel') + | {{{_ 'activity-added-label' lastLabel cardLink}}}. - if($eq activityType 'removedLabel') - | {{{_ 'activity-removed-label' lastLabel cardLink}}}. + if($eq activityType 'removedLabel') + | {{{_ 'activity-removed-label' lastLabel cardLink}}}. - if($eq activityType 'setCustomField') - | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}. + if($eq activityType 'setCustomField') + | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}. - if($eq activityType 'unsetCustomField') - | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}. + if($eq activityType 'unsetCustomField') + | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}. - if($eq activityType 'unjoinMember') - if($eq user._id member._id) - | {{{_ 'activity-unjoined' cardLink}}}. - else - | {{{_ 'activity-removed' memberLink cardLink}}}. + if($eq activityType 'unjoinMember') + if($eq user._id member._id) + | {{{_ 'activity-unjoined' cardLink}}}. + else + | {{{_ 'activity-removed' memberLink cardLink}}}. - span(title=createdAt).activity-meta {{ moment createdAt }} + span(title=createdAt).activity-meta {{ moment createdAt }} template(name="cardActivities") - if currentBoard.allowsComments - each currentCard.activities - .activity - +userAvatar(userId=user._id) - p.activity-desc - +memberName(user=user) - if($eq activityType 'createCard') - | {{_ 'activity-added' cardLabel listName}}. - if($eq activityType 'importCard') - | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}. - if($eq activityType 'joinMember') - if($eq user._id member._id) - | {{_ 'activity-joined' cardLabel}}. - else - | {{{_ 'activity-added' memberLink cardLabel}}}. - if($eq activityType 'unjoinMember') - if($eq user._id member._id) - | {{_ 'activity-unjoined' cardLabel}}. - else - | {{{_ 'activity-removed' cardLabel memberLink}}}. - if($eq activityType 'archivedCard') - | {{_ 'activity-archived' cardLabel}}. - - if($eq activityType 'addedLabel') - | {{{_ 'activity-added-label-card' lastLabel }}}. - - if($eq activityType 'removedLabel') - | {{{_ 'activity-removed-label-card' lastLabel }}}. - - if($eq activityType 'removeChecklist') - | {{{_ 'activity-checklist-removed' cardLabel}}}. - - if($eq activityType 'checkedItem') - | {{{_ 'activity-checked-item-card' checkItem checklist.title }}}. - - if($eq activityType 'uncheckedItem') - | {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}. - - if($eq activityType 'checklistCompleted') - | {{{_ 'activity-checklist-completed-card' checklist.title }}}. - - if($eq activityType 'checklistUncompleted') - | {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}. - - if($eq activityType 'restoredCard') - | {{_ 'activity-sent' cardLabel boardLabel}}. - if($eq activityType 'moveCard') - | {{_ 'activity-moved' cardLabel oldList.title list.title}}. - - if($eq activityType 'moveCardBoard') - | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. - - if($eq activityType 'addAttachment') - | {{{_ 'activity-attached' attachmentLink cardLabel}}}. - if attachment.isImage - img.attachment-image-preview(src=attachment.url) - if($eq activityType 'deleteAttachment') - | {{{_ 'activity-delete-attach' cardLabel}}}. - if($eq activityType 'removedChecklist') - | {{{_ 'activity-checklist-removed' cardLabel}}}. - if($eq activityType 'addChecklist') - | {{{_ 'activity-checklist-added' cardLabel}}}. - .activity-checklist - +viewer - = checklist.title - if($eq activityType 'addChecklistItem') - | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") + each currentCard.activities + .activity + +userAvatar(userId=user._id) + p.activity-desc + +memberName(user=user) + if($eq activityType 'createCard') + | {{_ 'activity-added' cardLabel listName}}. + if($eq activityType 'importCard') + | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}. + if($eq activityType 'joinMember') + if($eq user._id member._id) + | {{_ 'activity-joined' cardLabel}}. + else + | {{{_ 'activity-added' memberLink cardLabel}}}. + if($eq activityType 'unjoinMember') + if($eq user._id member._id) + | {{_ 'activity-unjoined' cardLabel}}. + else + | {{{_ 'activity-removed' cardLabel memberLink}}}. + if($eq activityType 'archivedCard') + | {{_ 'activity-archived' cardLabel}}. + + if($eq activityType 'addedLabel') + | {{{_ 'activity-added-label-card' lastLabel }}}. + + if($eq activityType 'removedLabel') + | {{{_ 'activity-removed-label-card' lastLabel }}}. + + if($eq activityType 'removeChecklist') + | {{{_ 'activity-checklist-removed' cardLabel}}}. + + if($eq activityType 'checkedItem') + | {{{_ 'activity-checked-item-card' checkItem checklist.title }}}. + + if($eq activityType 'uncheckedItem') + | {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}. + + if($eq activityType 'checklistCompleted') + | {{{_ 'activity-checklist-completed-card' checklist.title }}}. + + if($eq activityType 'checklistUncompleted') + | {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}. + + if($eq activityType 'restoredCard') + | {{_ 'activity-sent' cardLabel boardLabel}}. + if($eq activityType 'moveCard') + | {{_ 'activity-moved' cardLabel oldList.title list.title}}. + + if($eq activityType 'moveCardBoard') + | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. + + if($eq activityType 'addAttachment') + | {{{_ 'activity-attached' attachmentLink cardLabel}}}. + if attachment.isImage + img.attachment-image-preview(src=attachment.url) + if($eq activityType 'deleteAttachment') + | {{{_ 'activity-delete-attach' cardLabel}}}. + if($eq activityType 'removedChecklist') + | {{{_ 'activity-checklist-removed' cardLabel}}}. + if($eq activityType 'addChecklist') + | {{{_ 'activity-checklist-added' cardLabel}}}. + .activity-checklist + +viewer + = checklist.title + if($eq activityType 'addChecklistItem') + | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. + .activity-checklist(href="{{ card.absoluteUrl }}") + +viewer + = checklistItem.title + + if(currentData.timeKey) + | {{{_ activityType }}} + = ' ' + i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }} + if (currentData.timeOldValue) + = ' ' + | {{{_ "previous_as" }}} + = ' ' + i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }} + = ' @' + else if(currentData.timeValue) + | {{{_ activityType currentData.timeValue}}} + + + if($eq activityType 'deleteComment') + | {{{_ 'activity-deleteComment' currentData.commentId}}}. + if($eq activityType 'editComment') + | {{{_ 'activity-editComment' currentData.commentId}}}. + 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 - = checklistItem.title - - if(currentData.timeKey) - | {{{_ activityType }}} - = ' ' - i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }} - if (currentData.timeOldValue) - = ' ' - | {{{_ "previous_as" }}} - = ' ' - i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }} - = ' @' - else if(currentData.timeValue) - | {{{_ activityType currentData.timeValue}}} - - - if($eq activityType 'deleteComment') - | {{{_ 'activity-deleteComment' currentData.commentId}}}. - if($eq activityType 'editComment') - | {{{_ 'activity-editComment' currentData.commentId}}}. - 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(title=createdAt).activity-meta {{ moment createdAt }} - if ($eq currentUser._id comment.userId) - = ' - ' - a.js-open-inlined-form {{_ "edit"}} - = ' - ' - a.js-delete-comment {{_ "delete"}} - - else span(title=createdAt).activity-meta {{ moment createdAt }} + if ($eq currentUser._id comment.userId) + = ' - ' + a.js-open-inlined-form {{_ "edit"}} + = ' - ' + a.js-delete-comment {{_ "delete"}} + + else + span(title=createdAt).activity-meta {{ moment createdAt }} -- cgit v1.2.3-1-g7c22 From b9099a8b7ea6f63c79bdcbb871cb993b2cb7e325 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 24 Mar 2020 20:39:49 +0200 Subject: 1) Fix Pasting text into a card is adding a line before and after (and multiplies by pasting more) by changing paste "p" to "br". 2) Fixes to summernote and markdown comment editors, related to keeping them open when adding comments, having @member mention not close card, and disabling clicking of @member mention. Thanks to xet7 ! Closes #2890 --- client/components/activities/comments.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'client/components/activities') diff --git a/client/components/activities/comments.js b/client/components/activities/comments.js index 50ca019b..e885459e 100644 --- a/client/components/activities/comments.js +++ b/client/components/activities/comments.js @@ -33,6 +33,13 @@ BlazeComponent.extendComponent({ cardId, }); resetCommentInput(input); + // With Richer editor is in use, and comment is submitted, + // clear comment form with JQuery. Id #summernote is defined + // at client/components/main/editor.jade where it previously was + // id=id, now it is id="summernote". + if (Meteor.settings.public.RICHER_CARD_COMMENT_EDITOR === 'true') { + $('#summernote').summernote('code', ''); + } Tracker.flush(); autosize.update(input); input.trigger('submitted'); -- cgit v1.2.3-1-g7c22 From 9819c9f801128d07374b0703b482bdb83a672297 Mon Sep 17 00:00:00 2001 From: Jonathan Baird Date: Fri, 27 Mar 2020 11:35:03 -0600 Subject: add a notification drawer like trello --- client/components/activities/activities.jade | 347 ++++++++++++--------------- client/components/activities/activities.js | 111 ++++++--- 2 files changed, 229 insertions(+), 229 deletions(-) (limited to 'client/components/activities') diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade index 8ecbdee8..c86936a0 100644 --- a/client/components/activities/activities.jade +++ b/client/components/activities/activities.jade @@ -8,234 +8,201 @@ template(name="activities") +cardActivities template(name="boardActivities") - each currentBoard.activities - .activity - +userAvatar(userId=user._id) - p.activity-desc - +memberName(user=user) + each activityData in currentBoard.activities + +activity(activity=activityData card=card mode=mode) - if($eq activityType 'deleteAttachment') - | {{{_ 'activity-delete-attach' cardLink}}}. +template(name="cardActivities") + each activityData in currentCard.activities + +activity(activity=activityData card=card mode=mode) + +template(name="activity") + .activity + +userAvatar(userId=activity.user._id) + p.activity-desc + +memberName(user=activity.user) + + //- attachment activity ------------------------------------------------- + if($eq activity.activityType 'deleteAttachment') + | {{{_ 'activity-delete-attach' cardLink}}}. + + if($eq activity.activityType 'addAttachment') + | {{{_ 'activity-attached' attachmentLink cardLink}}}. + if($neq mode 'board') + if activity.attachment.isImage + img.attachment-image-preview(src=activity.attachment.url) + + //- board activity ------------------------------------------------------ + if($eq mode 'board') + if($eq activity.activityType 'createBoard') + | {{_ 'activity-created' boardLabel}}. - if($eq activityType 'addAttachment') - | {{{_ 'activity-attached' attachmentLink cardLink}}}. + if($eq activity.activityType 'importBoard') + | {{{_ 'activity-imported-board' boardLabel sourceLink}}}. - if($eq activityType 'addBoardMember') + if($eq activity.activityType 'addBoardMember') | {{{_ 'activity-added' memberLink boardLabel}}}. - if($eq activityType 'addComment') - | {{{_ 'activity-on' cardLink}}} - a.activity-comment(href="{{ card.absoluteUrl }}") - +viewer - = comment.text - - if($eq activityType 'addChecklist') - | {{{_ 'activity-checklist-added' cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklist.title - if($eq activityType 'removeChecklist') - | {{{_ 'activity-checklist-removed' cardLink}}}. - - if($eq activityType 'checkedItem') - | {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}. - - if($eq activityType 'uncheckedItem') - | {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}. - - if($eq activityType 'checklistCompleted') - | {{{_ 'activity-checklist-completed' checklist.title cardLink}}}. + if($eq activity.activityType 'removeBoardMember') + | {{{_ 'activity-excluded' memberLink boardLabel}}}. - if($eq activityType 'checklistUncompleted') - | {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}. + //- card activity ------------------------------------------------------- + if($eq activity.activityType 'createCard') + if($eq mode 'card') + | {{{_ 'activity-added' cardLabel activity.listName}}}. + else + | {{{_ 'activity-added' cardLabel boardLabel}}}. - if($eq activityType 'addChecklistItem') - | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklistItem.title - if($eq activityType 'removedChecklistItem') - | {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}. + if($eq activity.activityType 'importCard') + | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}. - if($eq activityType 'archivedCard') - | {{{_ 'activity-archived' cardLink}}}. + if($eq activity.activityType 'moveCard') + | {{{_ 'activity-moved' cardLabel activity.oldList.title activity.list.title}}}. - if($eq activityType 'archivedList') - | {{_ 'activity-archived' list.title}}. + if($eq activity.activityType 'moveCardBoard') + | {{{_ 'activity-moved' cardLink activity.oldBoardName activity.boardName}}}. - if($eq activityType 'archivedSwimlane') - | {{_ 'activity-archived' swimlane.title}}. + if($eq activity.activityType 'archivedCard') + | {{{_ 'activity-archived' cardLink}}}. - if($eq activityType 'createBoard') - | {{_ 'activity-created' boardLabel}}. + if($eq activity.activityType 'restoredCard') + | {{{_ 'activity-sent' cardLink boardLabel}}}. - if($eq activityType 'createCard') - | {{{_ 'activity-added' cardLink boardLabel}}}. + //- checklist activity -------------------------------------------------- + if($eq activity.activityType 'addChecklist') + | {{{_ 'activity-checklist-added' cardLink}}}. + if($eq mode 'card') + .activity-checklist + +viewer + = activity.checklist.title + else + a.activity-checklist(href="{{ activity.card.absoluteUrl }}") + +viewer + = activity.checklist.title - if($eq activityType 'createCustomField') - | {{_ 'activity-customfield-created' customField}}. + if($eq activity.activityType 'removedChecklist') + | {{{_ 'activity-checklist-removed' cardLink}}}. - if($eq activityType 'createList') - | {{_ 'activity-added' list.title boardLabel}}. + if($eq activity.activityType 'completeChecklist') + | {{{_ 'activity-checklist-completed' activity.checklist.title cardLink}}}. - if($eq activityType 'createSwimlane') - | {{_ 'activity-added' swimlane.title boardLabel}}. + if($eq activity.activityType 'uncompleteChecklist') + | {{{_ 'activity-checklist-uncompleted' activity.checklist.title cardLink}}}. - if($eq activityType 'removeList') - | {{_ 'activity-removed' title boardLabel}}. + if($eq activity.activityType 'checkedItem') + | {{{_ 'activity-checked-item' checkItem activity.checklist.title cardLink}}}. - if($eq activityType 'importBoard') - | {{{_ 'activity-imported-board' boardLabel sourceLink}}}. + if($eq activity.activityType 'uncheckedItem') + | {{{_ 'activity-unchecked-item' checkItem activity.checklist.title cardLink}}}. - if($eq activityType 'importCard') - | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}. + if($eq activity.activityType 'addChecklistItem') + | {{{_ 'activity-checklist-item-added' activity.checklist.title cardLink}}}. + .activity-checklist(href="{{ activity.card.absoluteUrl }}") + +viewer + = activity.checklistItem.title - if($eq activityType 'importList') - | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}. + if($eq activity.activityType 'removedChecklistItem') + | {{{_ 'activity-checklist-item-removed' activity.checklist.title cardLink}}}. - if($eq activityType 'joinMember') - if($eq user._id member._id) - | {{{_ 'activity-joined' cardLink}}}. + //- comment activity ---------------------------------------------------- + if($eq mode 'card') + //- if we are in card mode we display the comment in a way that it + //- can be edited by the owner + if($eq activity.activityType 'addComment') + +inlinedForm(classNames='js-edit-comment') + +editor(autofocus=true) + = activity.comment.text + .edit-controls + button.primary(type="submit") {{_ 'edit'}} else - | {{{_ 'activity-added' memberLink cardLink}}}. - - if($eq activityType 'moveCardBoard') - | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. - - if($eq activityType 'moveCard') - | {{{_ 'activity-moved' cardLink oldList.title list.title}}}. - - if($eq activityType 'removeBoardMember') - | {{{_ 'activity-excluded' memberLink boardLabel}}}. + .activity-comment + +viewer + = activity.comment.text + span(title=activity.createdAt).activity-meta {{ moment activity.createdAt }} + if ($eq currentUser._id activity.comment.userId) + = ' - ' + a.js-open-inlined-form {{_ "edit"}} + = ' - ' + a.js-delete-comment {{_ "delete"}} - if($eq activityType 'restoredCard') - | {{{_ 'activity-sent' cardLink boardLabel}}}. + if($eq activity.activityType 'deleteComment') + | {{{_ 'activity-deleteComment' currentData.commentId}}}. - if($eq activityType 'addedLabel') - | {{{_ 'activity-added-label' lastLabel cardLink}}}. + if($eq activity.activityType 'editComment') + | {{{_ 'activity-editComment' currentData.commentId}}}. + else + //- if we are not in card mode we only display a summary of the comment + if($eq activity.activityType 'addComment') + | {{{_ 'activity-on' cardLink}}} + a.activity-comment(href="{{ activity.card.absoluteUrl }}") + +viewer + = activity.comment.text - if($eq activityType 'removedLabel') - | {{{_ 'activity-removed-label' lastLabel cardLink}}}. + //- customField activity ------------------------------------------------ + if($eq mode 'board') + if($eq activity.activityType 'createCustomField') + | {{_ 'activity-customfield-created' customField}}. - if($eq activityType 'setCustomField') + if($eq activity.activityType 'setCustomField') | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}. - if($eq activityType 'unsetCustomField') + if($eq activity.activityType 'unsetCustomField') | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}. - if($eq activityType 'unjoinMember') - if($eq user._id member._id) - | {{{_ 'activity-unjoined' cardLink}}}. - else - | {{{_ 'activity-removed' memberLink cardLink}}}. + //- label activity ------------------------------------------------------ + if($eq activity.activityType 'addedLabel') + | {{{_ 'activity-added-label' lastLabel cardLink}}}. - span(title=createdAt).activity-meta {{ moment createdAt }} + if($eq activity.activityType 'removedLabel') + | {{{_ 'activity-removed-label' lastLabel cardLink}}}. -template(name="cardActivities") - each currentCard.activities - .activity - +userAvatar(userId=user._id) - p.activity-desc - +memberName(user=user) - if($eq activityType 'createCard') - | {{_ 'activity-added' cardLabel listName}}. - if($eq activityType 'importCard') - | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}. - if($eq activityType 'joinMember') - if($eq user._id member._id) - | {{_ 'activity-joined' cardLabel}}. - else - | {{{_ 'activity-added' memberLink cardLabel}}}. - if($eq activityType 'unjoinMember') - if($eq user._id member._id) - | {{_ 'activity-unjoined' cardLabel}}. - else - | {{{_ 'activity-removed' cardLabel memberLink}}}. - if($eq activityType 'archivedCard') - | {{_ 'activity-archived' cardLabel}}. - - if($eq activityType 'addedLabel') - | {{{_ 'activity-added-label-card' lastLabel }}}. + //- list activity ------------------------------------------------------- + if($neq mode 'card') + if($eq activity.activityType 'createList') + | {{{_ 'activity-added' listLabel boardLabel}}}. - if($eq activityType 'removedLabel') - | {{{_ 'activity-removed-label-card' lastLabel }}}. + if($eq activity.activityType 'importList') + | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}. - if($eq activityType 'removeChecklist') - | {{{_ 'activity-checklist-removed' cardLabel}}}. + if($eq activity.activityType 'removeList') + | {{{_ 'activity-removed' activity.title boardLabel}}}. - if($eq activityType 'checkedItem') - | {{{_ 'activity-checked-item-card' checkItem checklist.title }}}. + if($eq activity.activityType 'archivedList') + | {{_ 'activity-archived' listLabel}}. - if($eq activityType 'uncheckedItem') - | {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}. + //- member activity ---------------------------------------------------- + if($eq activity.activityType 'joinMember') + if($eq user._id activity.member._id) + | {{{_ 'activity-joined' cardLink}}}. + else + | {{{_ 'activity-added' memberLink cardLink}}}. - if($eq activityType 'checklistCompleted') - | {{{_ 'activity-checklist-completed-card' checklist.title }}}. + if($eq activity.activityType 'unjoinMember') + if($eq user._id activity.member._id) + | {{{_ 'activity-unjoined' cardLink}}}. + else + | {{{_ 'activity-removed' memberLink cardLink}}}. - if($eq activityType 'checklistUncompleted') - | {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}. + //- swimlane activity -------------------------------------------------- + if($neq mode 'card') + if($eq activity.activityType 'createSwimlane') + | {{{_ 'activity-added' activity.swimlane.title boardLabel}}}. - if($eq activityType 'restoredCard') - | {{_ 'activity-sent' cardLabel boardLabel}}. - if($eq activityType 'moveCard') - | {{_ 'activity-moved' cardLabel oldList.title list.title}}. + if($eq activity.activityType 'archivedSwimlane') + | {{_ 'activity-archived' activity.swimlane.title}}. - if($eq activityType 'moveCardBoard') - | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. - if($eq activityType 'addAttachment') - | {{{_ 'activity-attached' attachmentLink cardLabel}}}. - if attachment.isImage - img.attachment-image-preview(src=attachment.url) - if($eq activityType 'deleteAttachment') - | {{{_ 'activity-delete-attach' cardLabel}}}. - if($eq activityType 'removedChecklist') - | {{{_ 'activity-checklist-removed' cardLabel}}}. - if($eq activityType 'addChecklist') - | {{{_ 'activity-checklist-added' cardLabel}}}. - .activity-checklist - +viewer - = checklist.title - if($eq activityType 'addChecklistItem') - | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. - .activity-checklist(href="{{ card.absoluteUrl }}") - +viewer - = checklistItem.title - - if(currentData.timeKey) - | {{{_ activityType }}} + //- I don't understand this part ---------------------------------------- + if(currentData.timeKey) + | {{{_ activity.activityType }}} + = ' ' + i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }} + if (currentData.timeOldValue) = ' ' - i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }} - if (currentData.timeOldValue) - = ' ' - | {{{_ "previous_as" }}} - = ' ' - i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }} - = ' @' - else if(currentData.timeValue) - | {{{_ activityType currentData.timeValue}}} - - - if($eq activityType 'deleteComment') - | {{{_ 'activity-deleteComment' currentData.commentId}}}. - if($eq activityType 'editComment') - | {{{_ 'activity-editComment' currentData.commentId}}}. - 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(title=createdAt).activity-meta {{ moment createdAt }} - if ($eq currentUser._id comment.userId) - = ' - ' - a.js-open-inlined-form {{_ "edit"}} - = ' - ' - a.js-delete-comment {{_ "delete"}} - - else - span(title=createdAt).activity-meta {{ moment createdAt }} + | {{{_ "previous_as" }}} + = ' ' + i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }} + = ' @' + else if(currentData.timeValue) + | {{{_ activity.activityType currentData.timeValue}}} + + span(title=activity.createdAt).activity-meta {{ moment activity.createdAt }} diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index b082273a..36214e19 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -41,7 +41,9 @@ BlazeComponent.extendComponent({ }); }); }, +}).register('activities'); +BlazeComponent.extendComponent({ loadNextPage() { if (this.loadNextPageLocked === false) { this.page.set(this.page.get() + 1); @@ -50,41 +52,37 @@ BlazeComponent.extendComponent({ }, checkItem() { - const checkItemId = this.currentData().checklistItemId; + const checkItemId = this.currentData().activity.checklistItemId; const checkItem = ChecklistItems.findOne({ _id: checkItemId }); - return checkItem.title; + return checkItem && checkItem.title; }, boardLabel() { + const data = this.currentData(); + if (data.mode !== 'board') { + return createBoardLink(data.activity.board(), data.activity.listName); + } return TAPi18n.__('this-board'); }, cardLabel() { + const data = this.currentData(); + if (data.mode !== 'card') { + return createCardLink(this.currentData().activity.card()); + } return TAPi18n.__('this-card'); }, cardLink() { - const card = this.currentData().card(); - return ( - card && - Blaze.toHTML( - HTML.A( - { - href: card.absoluteUrl(), - class: 'action-card', - }, - card.title, - ), - ) - ); + return createCardLink(this.currentData().activity.card()); }, lastLabel() { - const lastLabelId = this.currentData().labelId; + const lastLabelId = this.currentData().activity.labelId; if (!lastLabelId) return null; - const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById( - lastLabelId, - ); + const lastLabel = Boards.findOne( + this.currentData().activity.boardId, + ).getLabelById(lastLabelId); if (lastLabel && (lastLabel.name === undefined || lastLabel.name === '')) { return lastLabel.color; } else { @@ -94,7 +92,7 @@ BlazeComponent.extendComponent({ lastCustomField() { const lastCustomField = CustomFields.findOne( - this.currentData().customFieldId, + this.currentData().activity.customFieldId, ); if (!lastCustomField) return null; return lastCustomField.name; @@ -102,10 +100,10 @@ BlazeComponent.extendComponent({ lastCustomFieldValue() { const lastCustomField = CustomFields.findOne( - this.currentData().customFieldId, + this.currentData().activity.customFieldId, ); if (!lastCustomField) return null; - const value = this.currentData().value; + const value = this.currentData().activity.value; if ( lastCustomField.settings.dropdownItems && lastCustomField.settings.dropdownItems.length > 0 @@ -122,11 +120,13 @@ BlazeComponent.extendComponent({ }, listLabel() { - return this.currentData().list().title; + const activity = this.currentData().activity; + const list = activity.list(); + return (list && list.title) || activity.title; }, sourceLink() { - const source = this.currentData().source; + const source = this.currentData().activity.source; if (source) { if (source.url) { return Blaze.toHTML( @@ -146,30 +146,31 @@ BlazeComponent.extendComponent({ memberLink() { return Blaze.toHTMLWithData(Template.memberName, { - user: this.currentData().member(), + user: this.currentData().activity.member(), }); }, attachmentLink() { - const attachment = this.currentData().attachment(); + const attachment = this.currentData().activity.attachment(); // trying to display url before file is stored generates js errors return ( - attachment && - attachment.url({ download: true }) && - Blaze.toHTML( - HTML.A( - { - href: attachment.url({ download: true }), - target: '_blank', - }, - attachment.name(), - ), - ) + (attachment && + attachment.url({ download: true }) && + Blaze.toHTML( + HTML.A( + { + href: attachment.url({ download: true }), + target: '_blank', + }, + attachment.name(), + ), + )) || + this.currentData().activity.attachmentName ); }, customField() { - const customField = this.currentData().customField(); + const customField = this.currentData().activity.customField(); if (!customField) return null; return customField.name; }, @@ -199,4 +200,36 @@ BlazeComponent.extendComponent({ }, ]; }, -}).register('activities'); +}).register('activity'); + +function createCardLink(card) { + return ( + card && + Blaze.toHTML( + HTML.A( + { + href: card.absoluteUrl(), + class: 'action-card', + }, + card.title, + ), + ) + ); +} + +function createBoardLink(board, list) { + let text = board.title; + if (list) text += `: ${list}`; + return ( + board && + Blaze.toHTML( + HTML.A( + { + href: board.absoluteUrl(), + class: 'action-board', + }, + text, + ), + ) + ); +} -- cgit v1.2.3-1-g7c22 From 3546d7aa02bc65cf1183cb493adeb543ba51945d Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 31 Mar 2020 16:56:32 +0300 Subject: Fix Browser always reload the whole page when I change one of the card color. Fixed by making label colors and text again editable. Regression from [Wekan v3.86 2)](https://github.com/wekan/wekan/commit/b9099a8b7ea6f63c79bdcbb871cb993b2cb7e325). Thanks to javen9881 and xet7 ! Closes #2971 --- client/components/activities/comments.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'client/components/activities') diff --git a/client/components/activities/comments.js b/client/components/activities/comments.js index e885459e..50ca019b 100644 --- a/client/components/activities/comments.js +++ b/client/components/activities/comments.js @@ -33,13 +33,6 @@ BlazeComponent.extendComponent({ cardId, }); resetCommentInput(input); - // With Richer editor is in use, and comment is submitted, - // clear comment form with JQuery. Id #summernote is defined - // at client/components/main/editor.jade where it previously was - // id=id, now it is id="summernote". - if (Meteor.settings.public.RICHER_CARD_COMMENT_EDITOR === 'true') { - $('#summernote').summernote('code', ''); - } Tracker.flush(); autosize.update(input); input.trigger('submitted'); -- cgit v1.2.3-1-g7c22 From fe6616941505b82d503899e2e27d5a2e95f39db3 Mon Sep 17 00:00:00 2001 From: Jonathan Baird Date: Thu, 9 Apr 2020 12:46:24 -0600 Subject: fix bug that prevents editing or deleting comments --- client/components/activities/activities.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/components/activities') diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index 36214e19..5d356f6e 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -180,7 +180,7 @@ BlazeComponent.extendComponent({ { // XXX We should use Popup.afterConfirmation here 'click .js-delete-comment'() { - const commentId = this.currentData().commentId; + const commentId = this.currentData().activity.commentId; CardComments.remove(commentId); }, 'submit .js-edit-comment'(evt) { @@ -188,7 +188,7 @@ BlazeComponent.extendComponent({ const commentText = this.currentComponent() .getValue() .trim(); - const commentId = Template.parentData().commentId; + const commentId = Template.parentData().activity.commentId; if (commentText) { CardComments.update(commentId, { $set: { -- cgit v1.2.3-1-g7c22