Remove hiding comments and activities.

This commit is contained in:
Lauri Ojansivu 2020-02-10 17:25:27 +02:00
parent 6eac38bde5
commit 2a54218f3f
3 changed files with 214 additions and 217 deletions

View file

@ -8,236 +8,234 @@ template(name="activities")
+cardActivities +cardActivities
template(name="boardActivities") template(name="boardActivities")
if currentBoard.allowsActivities each currentBoard.activities
each currentBoard.activities .activity
.activity +userAvatar(userId=user._id)
+userAvatar(userId=user._id) p.activity-desc
p.activity-desc +memberName(user=user)
+memberName(user=user)
if($eq activityType 'deleteAttachment') if($eq activityType 'deleteAttachment')
| {{{_ 'activity-delete-attach' cardLink}}}. | {{{_ 'activity-delete-attach' cardLink}}}.
if($eq activityType 'addAttachment') if($eq activityType 'addAttachment')
| {{{_ 'activity-attached' attachmentLink cardLink}}}. | {{{_ 'activity-attached' attachmentLink cardLink}}}.
if($eq activityType 'addBoardMember') if($eq activityType 'addBoardMember')
| {{{_ 'activity-added' memberLink boardLabel}}}. | {{{_ 'activity-added' memberLink boardLabel}}}.
if($eq activityType 'addComment') if($eq activityType 'addComment')
| {{{_ 'activity-on' cardLink}}} | {{{_ 'activity-on' cardLink}}}
a.activity-comment(href="{{ card.absoluteUrl }}") a.activity-comment(href="{{ card.absoluteUrl }}")
+viewer +viewer
= comment.text = comment.text
if($eq activityType 'addChecklist') if($eq activityType 'addChecklist')
| {{{_ 'activity-checklist-added' cardLink}}}. | {{{_ 'activity-checklist-added' cardLink}}}.
.activity-checklist(href="{{ card.absoluteUrl }}") .activity-checklist(href="{{ card.absoluteUrl }}")
+viewer +viewer
= checklist.title = checklist.title
if($eq activityType 'removeChecklist') if($eq activityType 'removeChecklist')
| {{{_ 'activity-checklist-removed' cardLink}}}. | {{{_ 'activity-checklist-removed' cardLink}}}.
if($eq activityType 'checkedItem') if($eq activityType 'checkedItem')
| {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}. | {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}.
if($eq activityType 'uncheckedItem') if($eq activityType 'uncheckedItem')
| {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}. | {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}.
if($eq activityType 'checklistCompleted') if($eq activityType 'checklistCompleted')
| {{{_ 'activity-checklist-completed' checklist.title cardLink}}}. | {{{_ 'activity-checklist-completed' checklist.title cardLink}}}.
if($eq activityType 'checklistUncompleted') if($eq activityType 'checklistUncompleted')
| {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}. | {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}.
if($eq activityType 'addChecklistItem') if($eq activityType 'addChecklistItem')
| {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}. | {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
.activity-checklist(href="{{ card.absoluteUrl }}") .activity-checklist(href="{{ card.absoluteUrl }}")
+viewer +viewer
= checklistItem.title = checklistItem.title
if($eq activityType 'removedChecklistItem') if($eq activityType 'removedChecklistItem')
| {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}. | {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}.
if($eq activityType 'archivedCard') if($eq activityType 'archivedCard')
| {{{_ 'activity-archived' cardLink}}}. | {{{_ 'activity-archived' cardLink}}}.
if($eq activityType 'archivedList') if($eq activityType 'archivedList')
| {{_ 'activity-archived' list.title}}. | {{_ 'activity-archived' list.title}}.
if($eq activityType 'archivedSwimlane') if($eq activityType 'archivedSwimlane')
| {{_ 'activity-archived' swimlane.title}}. | {{_ 'activity-archived' swimlane.title}}.
if($eq activityType 'createBoard') if($eq activityType 'createBoard')
| {{_ 'activity-created' boardLabel}}. | {{_ 'activity-created' boardLabel}}.
if($eq activityType 'createCard') if($eq activityType 'createCard')
| {{{_ 'activity-added' cardLink boardLabel}}}. | {{{_ 'activity-added' cardLink boardLabel}}}.
if($eq activityType 'createCustomField') if($eq activityType 'createCustomField')
| {{_ 'activity-customfield-created' customField}}. | {{_ 'activity-customfield-created' customField}}.
if($eq activityType 'createList') if($eq activityType 'createList')
| {{_ 'activity-added' list.title boardLabel}}. | {{_ 'activity-added' list.title boardLabel}}.
if($eq activityType 'createSwimlane') if($eq activityType 'createSwimlane')
| {{_ 'activity-added' swimlane.title boardLabel}}. | {{_ 'activity-added' swimlane.title boardLabel}}.
if($eq activityType 'removeList') if($eq activityType 'removeList')
| {{_ 'activity-removed' title boardLabel}}. | {{_ 'activity-removed' title boardLabel}}.
if($eq activityType 'importBoard') if($eq activityType 'importBoard')
| {{{_ 'activity-imported-board' boardLabel sourceLink}}}. | {{{_ 'activity-imported-board' boardLabel sourceLink}}}.
if($eq activityType 'importCard') if($eq activityType 'importCard')
| {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}. | {{{_ 'activity-imported' cardLink boardLabel sourceLink}}}.
if($eq activityType 'importList') if($eq activityType 'importList')
| {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}. | {{{_ 'activity-imported' listLabel boardLabel sourceLink}}}.
if($eq activityType 'joinMember') if($eq activityType 'joinMember')
if($eq user._id member._id) if($eq user._id member._id)
| {{{_ 'activity-joined' cardLink}}}. | {{{_ 'activity-joined' cardLink}}}.
else else
| {{{_ 'activity-added' memberLink cardLink}}}. | {{{_ 'activity-added' memberLink cardLink}}}.
if($eq activityType 'moveCardBoard') if($eq activityType 'moveCardBoard')
| {{{_ 'activity-moved' cardLink oldBoardName boardName}}}. | {{{_ 'activity-moved' cardLink oldBoardName boardName}}}.
if($eq activityType 'moveCard') if($eq activityType 'moveCard')
| {{{_ 'activity-moved' cardLink oldList.title list.title}}}. | {{{_ 'activity-moved' cardLink oldList.title list.title}}}.
if($eq activityType 'removeBoardMember') if($eq activityType 'removeBoardMember')
| {{{_ 'activity-excluded' memberLink boardLabel}}}. | {{{_ 'activity-excluded' memberLink boardLabel}}}.
if($eq activityType 'restoredCard') if($eq activityType 'restoredCard')
| {{{_ 'activity-sent' cardLink boardLabel}}}. | {{{_ 'activity-sent' cardLink boardLabel}}}.
if($eq activityType 'addedLabel') if($eq activityType 'addedLabel')
| {{{_ 'activity-added-label' lastLabel cardLink}}}. | {{{_ 'activity-added-label' lastLabel cardLink}}}.
if($eq activityType 'removedLabel') if($eq activityType 'removedLabel')
| {{{_ 'activity-removed-label' lastLabel cardLink}}}. | {{{_ 'activity-removed-label' lastLabel cardLink}}}.
if($eq activityType 'setCustomField') if($eq activityType 'setCustomField')
| {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}. | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}.
if($eq activityType 'unsetCustomField') if($eq activityType 'unsetCustomField')
| {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}. | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}.
if($eq activityType 'unjoinMember') if($eq activityType 'unjoinMember')
if($eq user._id member._id) if($eq user._id member._id)
| {{{_ 'activity-unjoined' cardLink}}}. | {{{_ 'activity-unjoined' cardLink}}}.
else else
| {{{_ 'activity-removed' memberLink cardLink}}}. | {{{_ 'activity-removed' memberLink cardLink}}}.
span(title=createdAt).activity-meta {{ moment createdAt }} span(title=createdAt).activity-meta {{ moment createdAt }}
template(name="cardActivities") template(name="cardActivities")
if currentBoard.allowsComments each currentCard.activities
each currentCard.activities .activity
.activity +userAvatar(userId=user._id)
+userAvatar(userId=user._id) p.activity-desc
p.activity-desc +memberName(user=user)
+memberName(user=user) if($eq activityType 'createCard')
if($eq activityType 'createCard') | {{_ 'activity-added' cardLabel listName}}.
| {{_ 'activity-added' cardLabel listName}}. if($eq activityType 'importCard')
if($eq activityType 'importCard') | {{{_ 'activity-imported' cardLabel list.title sourceLink}}}.
| {{{_ 'activity-imported' cardLabel list.title sourceLink}}}. if($eq activityType 'joinMember')
if($eq activityType 'joinMember') if($eq user._id member._id)
if($eq user._id member._id) | {{_ 'activity-joined' cardLabel}}.
| {{_ '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
= 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 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
= comment.text
span(title=createdAt).activity-meta {{ moment createdAt }} 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 }}

View file

@ -261,15 +261,14 @@ template(name="cardDetails")
if currentUser.isBoardMember if currentUser.isBoardMember
unless currentUser.isNoComments unless currentUser.isNoComments
+commentForm +commentForm
if currentBoard.allowsActivities unless currentUser.isNoComments
unless currentUser.isNoComments if isLoaded.get
if isLoaded.get if isLinkedCard
if isLinkedCard +activities(card=this mode="linkedcard")
+activities(card=this mode="linkedcard") else if isLinkedBoard
else if isLinkedBoard +activities(card=this mode="linkedboard")
+activities(card=this mode="linkedboard") else
else +activities(card=this mode="card")
+activities(card=this mode="card")
template(name="editCardTitleForm") template(name="editCardTitleForm")
textarea.js-edit-card-title(rows='1' autofocus dir="auto") textarea.js-edit-card-title(rows='1' autofocus dir="auto")

View file

@ -147,18 +147,18 @@ template(name="boardCardSettingsPopup")
span span
i.fa.fa-paperclip i.fa.fa-paperclip
| {{_ 'attachments'}} | {{_ 'attachments'}}
div.check-div //div.check-div
a.flex.js-field-has-comments(class="{{#if allowsComments}}is-checked{{/if}}") // a.flex.js-field-has-comments(class="{{#if allowsComments}}is-checked{{/if}}")
.materialCheckBox(class="{{#if allowsComments}}is-checked{{/if}}") // .materialCheckBox(class="{{#if allowsComments}}is-checked{{/if}}")
span // span
i.fa.fa-comment-o // i.fa.fa-comment-o
| {{_ 'comment'}} // | {{_ 'comment'}}
div.check-div //div.check-div
a.flex.js-field-has-comments(class="{{#if allowsActivities}}is-checked{{/if}}") // a.flex.js-field-has-activities(class="{{#if allowsActivities}}is-checked{{/if}}")
.materialCheckBox(class="{{#if allowsActivities}}is-checked{{/if}}") // .materialCheckBox(class="{{#if allowsActivities}}is-checked{{/if}}")
span // span
i.fa.fa-history // i.fa.fa-history
| {{_ 'activities'}} // | {{_ 'activities'}}
template(name="boardSubtaskSettingsPopup") template(name="boardSubtaskSettingsPopup")
form.board-subtask-settings form.board-subtask-settings