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>
This commit is contained in:
parent
2dcd97bf14
commit
8d1e6eb9b2
|
@ -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, this.getShareeObject(index)));
|
||||
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, 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()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue