diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-04-02 11:33:20 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-04-02 12:24:48 +0200 |
commit | b38445b17ad52e948c645ca8b98b06b0d18aa583 (patch) | |
tree | 7f3cbb8d98d73fbee18dc3b22c6ffed1a51c4033 /apps/comments/src | |
parent | 021751658e3999d834d34cc918771575fcf89bf9 (diff) | |
download | nextcloud-server-b38445b17ad52e948c645ca8b98b06b0d18aa583.tar.gz nextcloud-server-b38445b17ad52e948c645ca8b98b06b0d18aa583.zip |
Show comments and restore in popover menu
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/comments/src')
-rw-r--r-- | apps/comments/src/filesplugin.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/comments/src/filesplugin.js b/apps/comments/src/filesplugin.js index 939edc8c695..2073be09b69 100644 --- a/apps/comments/src/filesplugin.js +++ b/apps/comments/src/filesplugin.js @@ -29,7 +29,7 @@ */ OCA.Comments.FilesPlugin = { ignoreLists: [ - 'files_trashbin', + 'trashbin', 'files.public' ], @@ -79,8 +79,18 @@ // register "comment" action for reading comments fileList.fileActions.registerAction({ name: 'Comment', - displayName: t('comments', 'Comment'), + displayName: function(context) { + if (context && context.$file) { + var unread = parseInt(context.$file.data('comments-unread'), 10) + if (unread >= 0) { + return n('comments', '1 new comment', '{unread} new comments', unread, { unread: unread }) + } + } + return t('comments', 'Comment') + }, mime: 'all', + order: -140, + iconClass: 'icon-comment', permissions: OC.PERMISSION_READ, type: OCA.Files.FileActions.TYPE_INLINE, render: function(actionSpec, isDefault, context) { |