Skip to content

Commit

Permalink
Fix js strings if group sharing is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rullzer committed Mar 22, 2016
1 parent b9f325f commit 213248f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion core/js/config.php
Expand Up @@ -162,7 +162,8 @@
'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
'resharingAllowed' => \OCP\Share::isResharingAllowed(),
'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated')
'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated'),
'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing()
)
)
),
Expand Down
3 changes: 2 additions & 1 deletion core/js/shareconfigmodel.js
Expand Up @@ -26,7 +26,8 @@
isDefaultExpireDateEnabled: oc_appconfig.core.defaultExpireDateEnabled === true,
isRemoteShareAllowed: oc_appconfig.core.remoteShareAllowed,
defaultExpireDate: oc_appconfig.core.defaultExpireDate,
isResharingAllowed: oc_appconfig.core.resharingAllowed
isResharingAllowed: oc_appconfig.core.resharingAllowed,
allowGroupSharing: oc_appconfig.core.allowGroupSharing
},

/**
Expand Down
20 changes: 16 additions & 4 deletions core/js/sharedialogview.js
Expand Up @@ -216,8 +216,12 @@
.autocomplete("option", "autoFocus", true);
response(suggestions);
} else {
var title = t('core', 'No users or groups found for {search}', {search: $('.shareWithField').val()});
if (!view.configModel.get('allowGroupSharing')) {
title = t('core', 'No users found for {search}', {search: $('.shareWithField').val()});
}
$('.shareWithField').addClass('error')
.attr('data-original-title', t('core', 'No users or groups found for {search}', {search: $('.shareWithField').val()}))
.attr('data-original-title', title)
.tooltip('hide')
.tooltip({
placement: 'bottom',
Expand Down Expand Up @@ -386,10 +390,18 @@
},

_renderSharePlaceholderPart: function () {
var sharePlaceholder = t('core', 'Share with users or groups …');
if (this.configModel.get('isRemoteShareAllowed')) {
sharePlaceholder = t('core', 'Share with users, groups or remote users …');
var sharePlaceholder = t('core', 'Share with users…');

if (this.configModel.get('allowGroupSharing')) {
if (this.configModel.get('isRemoteShareAllowed')) {
sharePlaceholder = t('core', 'Share with users, groups or remote users…');
} else {
sharePlaceholder = t('core', 'Share with users or groups…')
}
} else if (this.configModel.get('isRemoteShareAllowed')) {
sharePlaceholder = t('core', 'Share with users or remote users…');
}

return sharePlaceholder;
},

Expand Down

0 comments on commit 213248f

Please sign in to comment.