diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index a9945b594e..6903dd57c3 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -190,6 +190,8 @@ var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex); var shareWithTitle = ''; var shareType = this.model.getShareType(shareIndex); + var sharedBy = this.model.getSharedBy(shareIndex); + var sharedByDisplayName = this.model.getSharedByDisplayName(shareIndex); var hasPermissionOverride = {}; if (shareType === OC.Share.SHARE_TYPE_GROUP) { @@ -211,6 +213,17 @@ shareWithTitle = shareWith; } + if (sharedBy !== oc_current_user) { + var empty = shareWithTitle === ''; + if (!empty) { + shareWithTitle += ' ('; + } + shareWithTitle += t('core', 'shared by {sharer}', {sharer: sharedByDisplayName}); + if (!empty) { + shareWithTitle += ')'; + } + } + var share = this.model.get('shares')[shareIndex]; var password = share.password; var hasPassword = password !== null && password !== ''; diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index 6bb8d75b91..bff006f7ef 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -47,6 +47,7 @@ * @property {Date} expiration optional? * @property {number} stime optional? * @property {string} uid_owner + * @property {string} displayname_owner */ /** @@ -407,6 +408,32 @@ return share.share_with_displayname; }, + /** + * @param shareIndex + * @returns {string} + */ + getSharedBy: function(shareIndex) { + /** @type OC.Share.Types.ShareInfo **/ + var share = this.get('shares')[shareIndex]; + if(!_.isObject(share)) { + throw "Unknown Share"; + } + return share.uid_owner; + }, + + /** + * @param shareIndex + * @returns {string} + */ + getSharedByDisplayName: function(shareIndex) { + /** @type OC.Share.Types.ShareInfo **/ + var share = this.get('shares')[shareIndex]; + if(!_.isObject(share)) { + throw "Unknown Share"; + } + return share.displayname_owner; + }, + /** * returns the array index of a sharee for a provided shareId *