Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Show comments and restore in popover menu
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
  • Loading branch information
skjnldsv committed Apr 2, 2019
commit b38445b17ad52e948c645ca8b98b06b0d18aa583
2 changes: 1 addition & 1 deletion apps/comments/js/comments.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/comments/js/comments.js.map

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions apps/comments/src/filesplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
OCA.Comments.FilesPlugin = {
ignoreLists: [
'files_trashbin',
'trashbin',
'files.public'
],

Expand Down Expand Up @@ -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) {
Expand Down
23 changes: 10 additions & 13 deletions apps/files/css/files.scss
Original file line number Diff line number Diff line change
Expand Up @@ -920,19 +920,8 @@ table.dragshadow td.size {
align-items: center;
justify-content: center;

&.action.action-share.permanent {
display: none;
}

/* In "Deleted files", do not show "Restore" text next to icon as there is no space */
&.action-restore.permanent span {
&:not(.icon) {
display: none;
}
}

/* If there is a comment, show it instead of the share icon */
&.action-comment ~ .action-share {
// hide all actions in grid view that are not the menu
&:not(.action-menu) {
display: none;
}
}
Expand All @@ -949,6 +938,14 @@ table.dragshadow td.size {
border-radius: 50%;
}
}
// force show the sharing entry in the dropdown menu
.action-restore-container.hidden {
display: block !important;
}
// force show the sharing entry in the dropdown menu
.action-comment-container.hidden {
display: block !important;
}
}

form {
Expand Down
2 changes: 1 addition & 1 deletion apps/systemtags/js/systemtags.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/systemtags/js/systemtags.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/systemtags/src/filesplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
OCA.SystemTags.FilesPlugin = {
ignoreLists: [
'files_trashbin',
'trashbin',
'files.public'
],

Expand Down