summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-19 16:38:04 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-23 13:32:13 +0100
commit4247936dd6d5ea2fa60586e0f4aa4acbc7d902f1 (patch)
treee02e3d32ea909ddbf7abf1f570c122a46bb6baed
parentdcfd7bf7fffb6b7c946011870f1ae8a292937ddd (diff)
downloadnextcloud-server-4247936dd6d5ea2fa60586e0f4aa4acbc7d902f1.tar.gz
nextcloud-server-4247936dd6d5ea2fa60586e0f4aa4acbc7d902f1.zip
Fix avatars in file rows of incoming shares
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/files_sharing/js/share.js1
-rw-r--r--apps/files_sharing/js/sharedfilelist.js1
-rw-r--r--core/js/share.js11
3 files changed, 8 insertions, 5 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index dbfce6e83b5..a7eefe43dbe 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -46,6 +46,7 @@
tr.attr('data-share-permissions', sharePermissions);
if (fileData.shareOwner) {
tr.attr('data-share-owner', fileData.shareOwner);
+ tr.attr('data-share-owner-id', fileData.shareOwnerId);
// user should always be able to rename a mount point
if (fileData.mountType === 'shared-root') {
tr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE);
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index b32ee97f716..c7b872772b3 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -297,6 +297,7 @@
};
if (self._sharedWithUser) {
file.shareOwner = share.displayname_owner;
+ file.shareOwnerId = share.uid_owner;
file.name = OC.basename(share.file_target);
file.path = OC.dirname(share.file_target);
file.permissions = share.permissions;
diff --git a/core/js/share.js b/core/js/share.js
index 44f4f12f833..281c414b900 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -266,12 +266,13 @@ OC.Share = _.extend(OC.Share || {}, {
var type = $tr.data('type');
var icon = action.find('.icon');
var message, recipients, avatars;
+ var ownerId = $tr.attr('data-share-owner-id');
var owner = $tr.attr('data-share-owner');
var shareFolderIcon;
var iconClass = 'icon-shared';
action.removeClass('shared-style');
// update folder icon
- if (type === 'dir' && (hasShares || hasLink || owner)) {
+ if (type === 'dir' && (hasShares || hasLink || ownerId)) {
if (hasLink) {
shareFolderIcon = OC.MimeType.getIconUrl('dir-public');
}
@@ -295,21 +296,21 @@ OC.Share = _.extend(OC.Share || {}, {
$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');
}
// update share action text / icon
- if (hasShares || owner) {
+ if (hasShares || ownerId) {
recipients = $tr.data('share-recipient-data');
action.addClass('shared-style');
avatars = '<span>' + t('core', 'Shared') + '</span>';
// even if reshared, only show "Shared by"
- if (owner) {
+ if (ownerId) {
message = t('core', 'Shared by');
- avatars = this._formatRemoteShare(owner, message);
+ avatars = this._formatRegularShare(ownerId, owner, message);
} else if (recipients) {
avatars = this._formatShareList(recipients);
}
action.html(avatars).prepend(icon);
- if (owner || recipients) {
+ if (ownerId || recipients) {
var avatarElement = action.find('.avatar');
avatarElement.each(function () {
$(this).avatar($(this).data('username'), 32);