unified way to display remote shares and mail shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
8c8a019b7e
commit
392c8a115f
4 changed files with 17 additions and 10 deletions
|
@ -298,7 +298,7 @@ class ShareesAPIController extends OCSController {
|
||||||
$foundRemoteById = true;
|
$foundRemoteById = true;
|
||||||
}
|
}
|
||||||
$this->result['exact']['remotes'][] = [
|
$this->result['exact']['remotes'][] = [
|
||||||
'label' => $contact['FN'],
|
'label' => $contact['FN'] . " ($cloudId)",
|
||||||
'value' => [
|
'value' => [
|
||||||
'shareType' => Share::SHARE_TYPE_REMOTE,
|
'shareType' => Share::SHARE_TYPE_REMOTE,
|
||||||
'shareWith' => $cloudId,
|
'shareWith' => $cloudId,
|
||||||
|
@ -307,7 +307,7 @@ class ShareesAPIController extends OCSController {
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
$this->result['remotes'][] = [
|
$this->result['remotes'][] = [
|
||||||
'label' => $contact['FN'],
|
'label' => $contact['FN'] . " ($cloudId)",
|
||||||
'value' => [
|
'value' => [
|
||||||
'shareType' => Share::SHARE_TYPE_REMOTE,
|
'shareType' => Share::SHARE_TYPE_REMOTE,
|
||||||
'shareWith' => $cloudId,
|
'shareWith' => $cloudId,
|
||||||
|
|
|
@ -23,8 +23,10 @@
|
||||||
*/
|
*/
|
||||||
namespace OCA\Files_Sharing\Tests\Controller;
|
namespace OCA\Files_Sharing\Tests\Controller;
|
||||||
|
|
||||||
|
use OC\ContactsManager;
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
use OCP\AppFramework\Http\DataResponse;
|
||||||
use OCP\AppFramework\OCS\OCSNotFoundException;
|
use OCP\AppFramework\OCS\OCSNotFoundException;
|
||||||
|
use OCP\Contacts;
|
||||||
use OCP\Files\Folder;
|
use OCP\Files\Folder;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
use OCA\Files_Sharing\Controller\ShareAPIController;
|
use OCA\Files_Sharing\Controller\ShareAPIController;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
'{{#if avatarEnabled}}' +
|
'{{#if avatarEnabled}}' +
|
||||||
'<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' +
|
'<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' +
|
||||||
'{{/if}}' +
|
'{{/if}}' +
|
||||||
'<span class="has-tooltip username" title="{{shareWith}}">{{shareWithDisplayName}}</span>' +
|
'<span class="has-tooltip username" title="{{shareWithTitle}}">{{shareWithDisplayName}}</span>' +
|
||||||
'<span class="sharingOptionsGroup">' +
|
'<span class="sharingOptionsGroup">' +
|
||||||
'{{#if editPermissionPossible}}' +
|
'{{#if editPermissionPossible}}' +
|
||||||
'<span class="shareOption">' +
|
'<span class="shareOption">' +
|
||||||
|
@ -141,6 +141,7 @@
|
||||||
getShareeObject: function(shareIndex) {
|
getShareeObject: function(shareIndex) {
|
||||||
var shareWith = this.model.getShareWith(shareIndex);
|
var shareWith = this.model.getShareWith(shareIndex);
|
||||||
var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex);
|
var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex);
|
||||||
|
var shareWithTitle = '';
|
||||||
var shareType = this.model.getShareType(shareIndex);
|
var shareType = this.model.getShareType(shareIndex);
|
||||||
|
|
||||||
var hasPermissionOverride = {};
|
var hasPermissionOverride = {};
|
||||||
|
@ -148,6 +149,16 @@
|
||||||
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'group') + ')';
|
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'group') + ')';
|
||||||
} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {
|
} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {
|
||||||
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'remote') + ')';
|
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'remote') + ')';
|
||||||
|
} else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
|
||||||
|
shareWithDisplayName = shareWithDisplayName + " (" + t('core', 'email') + ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shareType === OC.Share.SHARE_TYPE_GROUP) {
|
||||||
|
shareWithTitle = shareWith + " (" + t('core', 'group') + ')';
|
||||||
|
} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {
|
||||||
|
shareWithTitle = shareWith + " (" + t('core', 'remote') + ')';
|
||||||
|
} else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
|
||||||
|
shareWithTitle = shareWith + " (" + t('core', 'email') + ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
return _.extend(hasPermissionOverride, {
|
return _.extend(hasPermissionOverride, {
|
||||||
|
@ -160,6 +171,7 @@
|
||||||
wasMailSent: this.model.notificationMailWasSent(shareIndex),
|
wasMailSent: this.model.notificationMailWasSent(shareIndex),
|
||||||
shareWith: shareWith,
|
shareWith: shareWith,
|
||||||
shareWithDisplayName: shareWithDisplayName,
|
shareWithDisplayName: shareWithDisplayName,
|
||||||
|
shareWithTitle: shareWithTitle,
|
||||||
shareType: shareType,
|
shareType: shareType,
|
||||||
shareId: this.model.get('shares')[shareIndex].id,
|
shareId: this.model.get('shares')[shareIndex].id,
|
||||||
modSeed: shareType !== OC.Share.SHARE_TYPE_USER,
|
modSeed: shareType !== OC.Share.SHARE_TYPE_USER,
|
||||||
|
|
|
@ -272,16 +272,9 @@
|
||||||
sharee: text
|
sharee: text
|
||||||
});
|
});
|
||||||
} else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) {
|
} else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) {
|
||||||
if (item.value.server) {
|
|
||||||
text = t('core', '{sharee} (at {server})', {
|
|
||||||
sharee: text,
|
|
||||||
server: item.value.server
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
text = t('core', '{sharee} (remote)', {
|
text = t('core', '{sharee} (remote)', {
|
||||||
sharee: text
|
sharee: text
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) {
|
} else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) {
|
||||||
text = t('core', '{sharee} (email)', {
|
text = t('core', '{sharee} (email)', {
|
||||||
sharee: text
|
sharee: text
|
||||||
|
|
Loading…
Reference in a new issue