Show share owner avatars on all file lists

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-02-09 11:42:47 +01:00
parent 0841d29c4c
commit cae311460a
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@
_.extend(OC.Files.Client, { _.extend(OC.Files.Client, {
PROPERTY_SHARE_TYPES: '{' + OC.Files.Client.NS_OWNCLOUD + '}share-types', PROPERTY_SHARE_TYPES: '{' + OC.Files.Client.NS_OWNCLOUD + '}share-types',
PROPERTY_OWNER_ID: '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-id',
PROPERTY_OWNER_DISPLAY_NAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name' PROPERTY_OWNER_DISPLAY_NAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name'
}); });
@ -66,6 +67,7 @@
var fileInfo = oldElementToFile.apply(this, arguments); var fileInfo = oldElementToFile.apply(this, arguments);
fileInfo.sharePermissions = $el.attr('data-share-permissions') || undefined; fileInfo.sharePermissions = $el.attr('data-share-permissions') || undefined;
fileInfo.shareOwner = $el.attr('data-share-owner') || undefined; fileInfo.shareOwner = $el.attr('data-share-owner') || undefined;
fileInfo.shareOwnerId = $el.attr('data-share-owner-id') || undefined;
if( $el.attr('data-share-types')){ if( $el.attr('data-share-types')){
fileInfo.shareTypes = $el.attr('data-share-types').split(','); fileInfo.shareTypes = $el.attr('data-share-types').split(',');
@ -83,6 +85,7 @@
var oldGetWebdavProperties = fileList._getWebdavProperties; var oldGetWebdavProperties = fileList._getWebdavProperties;
fileList._getWebdavProperties = function() { fileList._getWebdavProperties = function() {
var props = oldGetWebdavProperties.apply(this, arguments); var props = oldGetWebdavProperties.apply(this, arguments);
props.push(OC.Files.Client.PROPERTY_OWNER_ID);
props.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME); props.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME);
props.push(OC.Files.Client.PROPERTY_SHARE_TYPES); props.push(OC.Files.Client.PROPERTY_SHARE_TYPES);
return props; return props;
@ -95,6 +98,7 @@
if (permissionsProp && permissionsProp.indexOf('S') >= 0) { if (permissionsProp && permissionsProp.indexOf('S') >= 0) {
data.shareOwner = props[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME]; data.shareOwner = props[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME];
data.shareOwnerId = props[OC.Files.Client.PROPERTY_OWNER_ID];
} }
var shareTypesProp = props[OC.Files.Client.PROPERTY_SHARE_TYPES]; var shareTypesProp = props[OC.Files.Client.PROPERTY_SHARE_TYPES];