summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-04-11 14:46:22 +0200
committerGitHub <noreply@github.com>2017-04-11 14:46:22 +0200
commitbd6273ee1c803b8a129fb76135ca23377805da9e (patch)
tree8356ff0073f4adff95ae4501037a7e705f359b0d
parentafb5d45705f7d7743b9dfd2d79b618938cb05b77 (diff)
parent58f959864abbce05af586a162fde2fc10b039478 (diff)
downloadnextcloud-server-bd6273ee1c803b8a129fb76135ca23377805da9e.tar.gz
nextcloud-server-bd6273ee1c803b8a129fb76135ca23377805da9e.zip
Merge pull request #4280 from nextcloud/share_via_display
Show 'shared via' in share list for reshares
-rw-r--r--core/js/sharedialogshareelistview.js13
-rw-r--r--core/js/shareitemmodel.js27
2 files changed, 40 insertions, 0 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index a9945b594e1..6903dd57c33 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 6bb8d75b91f..bff006f7ef3 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
*/
/**
@@ -408,6 +409,32 @@
},
/**
+ * @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
*
* @param shareId