diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2016-10-10 15:27:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-10 15:27:00 +0200 |
commit | ad1eb8bd76c0583957b63109c330cdd0c6d57448 (patch) | |
tree | b43fb4b111e3e8055e577ffe7391d87508a364a6 | |
parent | 2dcd97bf144fac80d68df813d9d002bcbe3e1d6b (diff) | |
parent | de69f7a89961e36a3bd61688caae393433d81641 (diff) | |
download | nextcloud-server-ad1eb8bd76c0583957b63109c330cdd0c6d57448.tar.gz nextcloud-server-ad1eb8bd76c0583957b63109c330cdd0c6d57448.zip |
Merge pull request #1114 from nextcloud/display_all_reshares
Display link reshares
-rw-r--r-- | core/js/sharedialogshareelistview.js | 54 | ||||
-rw-r--r-- | core/js/shareitemmodel.js | 2 |
2 files changed, 52 insertions, 4 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 212bca96186..0125a433a32 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -81,7 +81,20 @@ '</span>' + '</li>' + '{{/each}}' + - '</ul>'; + '{{#each linkReshares}}' + + '<li data-share-id="{{shareId}}" data-share-type="{{shareType}}">' + + '{{#if avatarEnabled}}' + + '<div class="avatar" data-username="{{shareInitiator}}"></div>' + + '{{/if}}' + + '<span class="has-tooltip username" title="{{shareInitiator}}">' + t('core', '{{shareInitiatorDisplayName}} shared via link') + '</span>' + + + '<span class="sharingOptionsGroup">' + + '<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">{{unshareLabel}}</span></a>' + + '</span>' + + '</li>' + + '{{/each}}' + + '</ul>' + ; /** * @class OCA.Share.ShareDialogShareeListView @@ -192,9 +205,43 @@ var shares = this.model.get('shares'); var list = []; for(var index = 0; index < shares.length; index++) { + var share = this.getShareeObject(index); + + if (share.shareType === OC.Share.SHARE_TYPE_LINK) { + continue; + } + // first empty {} is necessary, otherwise we get in trouble + // with references + list.push(_.extend({}, universal, share)); + } + + return list; + }, + + getLinkReshares: function() { + var universal = { + unshareLabel: t('core', 'Unshare'), + avatarEnabled: this.configModel.areAvatarsEnabled(), + }; + + if(!this.model.hasUserShares()) { + return []; + } + + var shares = this.model.get('shares'); + var list = []; + for(var index = 0; index < shares.length; index++) { + var share = this.getShareeObject(index); + + if (share.shareType !== OC.Share.SHARE_TYPE_LINK) { + continue; + } // first empty {} is necessary, otherwise we get in trouble // with references - list.push(_.extend({}, universal, this.getShareeObject(index))); + list.push(_.extend({}, universal, share, { + shareInitiator: shares[index].uid_owner, + shareInitiatorDisplayName: shares[index].displayname_owner + })); } return list; @@ -203,7 +250,8 @@ render: function() { this.$el.html(this.template({ cid: this.cid, - sharees: this.getShareeList() + sharees: this.getShareeList(), + linkReshares: this.getLinkReshares() })); if(this.configModel.areAvatarsEnabled()) { diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index 00c1212fa79..e8a0d17a7c2 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -763,7 +763,7 @@ * FIXME: Find a way to display properly */ if (share.uid_owner !== OC.currentUser) { - return share; + return; } var link = window.location.protocol + '//' + window.location.host; |