summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Gallarello <angelo.gallarell@gmail.com>2018-08-16 17:18:55 +0200
committerAngelo Gallarello <angelo.gallarell@gmail.com>2018-08-16 17:18:55 +0200
commitf7446ba9346d52431a9d37c8b4c856daf2c73621 (patch)
treeacfc752a7cf1d11ba40648aecd6e169eb8570a96
parent9c6d374b950e8c4bd0c1c905cf36c953581a3156 (diff)
downloadwekan-f7446ba9346d52431a9d37c8b4c856daf2c73621.tar.gz
wekan-f7446ba9346d52431a9d37c8b4c856daf2c73621.tar.bz2
wekan-f7446ba9346d52431a9d37c8b4c856daf2c73621.zip
Remove attachment activity
-rw-r--r--client/components/activities/activities.jade5
-rw-r--r--i18n/en.i18n.json3
-rw-r--r--models/attachments.js7
-rw-r--r--server/triggersDef.js8
4 files changed, 22 insertions, 1 deletions
diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade
index 735de57b..68d225f3 100644
--- a/client/components/activities/activities.jade
+++ b/client/components/activities/activities.jade
@@ -14,6 +14,9 @@ template(name="boardActivities")
p.activity-desc
+memberName(user=user)
+ if($eq activityType 'deleteAttachment')
+ | {{{_ 'activity-delete-attach' cardLink}}}.
+
if($eq activityType 'addAttachment')
| {{{_ 'activity-attached' attachmentLink cardLink}}}.
@@ -134,6 +137,8 @@ template(name="cardActivities")
| {{{_ 'activity-attached' attachmentLink cardLabel}}}.
if attachment.isImage
img.attachment-image-preview(src=attachment.url)
+ if($eq activityType 'deleteAttachment')
+ | {{{_ 'activity-attached' attachmentLink cardLabel}}}.
if($eq activityType 'addChecklist')
| {{{_ 'activity-checklist-added' cardLabel}}}.
.activity-checklist
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index 01a2da73..b54787b9 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -501,6 +501,7 @@
"source-board": "Source board",
"no-parent": "Don't show parent",
"activity-added-label": "added label '%s' to %s",
- "activity-removed-label": "removed label '%s' from %s"
+ "activity-removed-label": "removed label '%s' from %s",
+ "activity-delete-attach": "deleted an attachment from %s"
}
diff --git a/models/attachments.js b/models/attachments.js
index 91dd0dbc..d769de34 100644
--- a/models/attachments.js
+++ b/models/attachments.js
@@ -86,5 +86,12 @@ if (Meteor.isServer) {
Activities.remove({
attachmentId: doc._id,
});
+ Activities.insert({
+ userId,
+ type: 'card',
+ activityType: 'deleteAttachment',
+ boardId: doc.boardId,
+ cardId: doc.cardId,
+ });
});
}
diff --git a/server/triggersDef.js b/server/triggersDef.js
index 89541147..8a3dcb6f 100644
--- a/server/triggersDef.js
+++ b/server/triggersDef.js
@@ -22,7 +22,15 @@ TriggersDef = {
},
addChecklistItem:{
matchingFields: ["boardId","checklistItemId"]
+ },
+ addAttachment:{
+ matchingFields: ["boardId","checklistId"]
+ },
+ deleteAttachment:{
+ matchingFields: ["boardId","checklistItemId"]
}
+
+
}