Merge pull request #21548 from owncloud/issue-21511-correctly-display-notify-option-for-shares

Check the correct config for displaying the "notify by email" option
remotes/origin/files-ui-webdav-upload
Thomas Müller 2016-01-08 18:19:09 +07:00
commit 756876b5dc
3 changed files with 10 additions and 3 deletions

@ -49,6 +49,13 @@
return $('input:hidden[name=mailPublicNotificationEnabled]').val() === 'yes';
},
/**
* @returns {boolean}
*/
isMailNotificationEnabled: function() {
return $('input:hidden[name=mailNotificationEnabled]').val() === 'yes';
},
/**
* @returns {boolean}
*/

@ -26,7 +26,7 @@
' <div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' +
' {{/if}}' +
' <span class="username">{{shareWithDisplayName}}</span>' +
' {{#if mailPublicNotificationEnabled}} {{#unless isRemoteShare}}' +
' {{#if mailNotificationEnabled}} {{#unless isRemoteShare}}' +
' <input id="mail-{{cid}}-{{shareWith}}" type="checkbox" name="mailNotification" class="mailNotification checkbox" {{#if wasMailSent}}checked="checked"{{/if}} />' +
' <label for="mail-{{cid}}-{{shareWith}}">{{notifyByMailLabel}}</label>' +
' {{/unless}} {{/if}}' +
@ -164,7 +164,7 @@
getShareeList: function() {
var universal = {
avatarEnabled: this.configModel.areAvatarsEnabled(),
mailPublicNotificationEnabled: this.configModel.isMailPublicNotificationEnabled(),
mailNotificationEnabled: this.configModel.isMailNotificationEnabled(),
notifyByMailLabel: t('core', 'notify by email'),
unshareLabel: t('core', 'Unshare'),
unshareImage: OC.imagePath('core', 'actions/delete'),

@ -34,7 +34,7 @@ describe('OC.Share.ShareDialogShareeListView', function () {
oldAppConfig = _.extend({}, oc_appconfig.core);
oc_appconfig.core.enforcePasswordForPublicLink = false;
$('#testArea').append('<input id="mailPublicNotificationEnabled" name="mailPublicNotificationEnabled" type="hidden" value="yes">');
$('#testArea').append('<input id="mailNotificationEnabled" name="mailNotificationEnabled" type="hidden" value="yes">');
fileInfoModel = new OCA.Files.FileInfoModel({
id: 123,