summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/share.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/src/share.js')
-rw-r--r--apps/files_sharing/src/share.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/files_sharing/src/share.js b/apps/files_sharing/src/share.js
index b02c6e3d9ee..f253dcb2db9 100644
--- a/apps/files_sharing/src/share.js
+++ b/apps/files_sharing/src/share.js
@@ -162,11 +162,33 @@
fileActions.registerAction({
name: 'Share',
- displayName: '',
+ displayName: function(context) {
+ if (context && context.$file) {
+ var shareType = parseInt(context.$file.data('share-types'), 10)
+ var shareOwner = context.$file.data('share-owner-id')
+ if (shareType >= 0 || shareOwner) {
+ return t('core', 'Shared')
+ }
+ }
+ return t('core', 'Share')
+ },
altText: t('core', 'Share'),
mime: 'all',
+ order: -60,
permissions: OC.PERMISSION_ALL,
- iconClass: 'icon-shared',
+ iconClass: function(fileName, context) {
+ var shareType = parseInt(context.$file.data('share-types'), 10)
+ if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
+ return 'icon-public'
+ }
+ return 'icon-shared'
+ },
+ icon: function(fileName, context) {
+ var shareOwner = context.$file.data('share-owner-id')
+ if (shareOwner) {
+ return OC.generateUrl(`/avatar/${shareOwner}/32`)
+ }
+ },
type: OCA.Files.FileActions.TYPE_INLINE,
actionHandler: function(fileName, context) {
// do not open sidebar if permission is set and equal to 0