diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-28 20:59:12 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-10 12:53:14 +0200 |
commit | 8d1e6eb9b21359878b5be3aa4c69f77e0cf5abfe (patch) | |
tree | d19836e4163da0b96e50a95015b0caa541127d13 /core/js | |
parent | 2dcd97bf144fac80d68df813d9d002bcbe3e1d6b (diff) | |
download | nextcloud-server-8d1e6eb9b21359878b5be3aa4c69f77e0cf5abfe.tar.gz nextcloud-server-8d1e6eb9b21359878b5be3aa4c69f77e0cf5abfe.zip |
Display link reshares
* No longer filterout all other link shares
* Display link shares in shareelist (below normal shares)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/sharedialogshareelistview.js | 48 | ||||
-rw-r--r-- | core/js/shareitemmodel.js | 2 |
2 files changed, 46 insertions, 4 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 212bca96186..caeb082163f 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -81,7 +81,15 @@ '</span>' + '</li>' + '{{/each}}' + - '</ul>'; + '{{#each linkReshares}}' + + '<li data-share-id="{{shareId}}" data-share-type="{{shareType}}">' + + '<span class="icon icon-public"></span>' + + '<span class="has-tooltip username" title="{{shareInitiator}}">{{shareInitiatorDisplayName}}</span>' + + '<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">{{unshareLabel}}</span></a>' + + '</li>' + + '{{/each}}' + + '</ul>' + ; /** * @class OCA.Share.ShareDialogShareeListView @@ -192,9 +200,42 @@ 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'), + }; + + 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 +244,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; |