integraton noshare part into ShareDialogLinkShareView
This commit is contained in:
parent
8f3884145e
commit
6af6024e17
|
@ -14,32 +14,34 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var TEMPLATE =
|
var TEMPLATE =
|
||||||
'<div id="link" class="linkShare">' +
|
'{{#if shareAllowed}}' +
|
||||||
' <span class="icon-loading-small hidden"></span>' +
|
'<span class="icon-loading-small hidden"></span>' +
|
||||||
' <input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">{{linkShareLabel}}</label>' +
|
'<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">{{linkShareLabel}}</label>' +
|
||||||
' <br />' +
|
'<br />' +
|
||||||
' <label for="linkText" class="hidden-visually">{{urlLabel}}</label>' +
|
'<label for="linkText" class="hidden-visually">{{urlLabel}}</label>' +
|
||||||
' <input id="linkText" type="text" readonly="readonly" />' +
|
'<input id="linkText" type="text" readonly="readonly" />' +
|
||||||
' <input type="checkbox" name="showPassword" id="showPassword" value="1" class="hidden" /><label for="showPassword" class="hidden-visually">{{enablePasswordLabel}}</label>' +
|
'<input type="checkbox" name="showPassword" id="showPassword" value="1" class="hidden" /><label for="showPassword" class="hidden-visually">{{enablePasswordLabel}}</label>' +
|
||||||
' <div id="linkPass">' +
|
'<div id="linkPass">' +
|
||||||
' <label for="linkPassText" class="hidden-visually">{{passwordLabel}}</label>' +
|
' <label for="linkPassText" class="hidden-visually">{{passwordLabel}}</label>' +
|
||||||
' <input id="linkPassText" type="password" placeholder="passwordPlaceholder" />' +
|
' <input id="linkPassText" type="password" placeholder="passwordPlaceholder" />' +
|
||||||
' <span class="icon-loading-small hidden"></span>' +
|
' <span class="icon-loading-small hidden"></span>' +
|
||||||
' </div>' +
|
'</div>' +
|
||||||
' {{#if publicUpload}}' +
|
' {{#if publicUpload}}' +
|
||||||
' <div id="allowPublicUploadWrapper" class="hidden">' +
|
'<div id="allowPublicUploadWrapper" class="hidden">' +
|
||||||
' <span class="icon-loading-small hidden"></span>' +
|
' <span class="icon-loading-small hidden"></span>' +
|
||||||
' <input type="checkbox" value="1" name="allowPublicUpload" id="sharingDialogAllowPublicUpload" {{{publicUploadChecked}}} />' +
|
' <input type="checkbox" value="1" name="allowPublicUpload" id="sharingDialogAllowPublicUpload" {{{publicUploadChecked}}} />' +
|
||||||
' <label for="sharingDialogAllowPublicUpload">{{publicUploadLabel}}</label>' +
|
' <label for="sharingDialogAllowPublicUpload">{{publicUploadLabel}}</label>' +
|
||||||
' </div>' +
|
'</div>' +
|
||||||
' {{/if}}' +
|
' {{/if}}' +
|
||||||
' {{#if mailPublicNotificationEnabled}}' +
|
' {{#if mailPublicNotificationEnabled}}' +
|
||||||
' <form id="emailPrivateLink">' +
|
'<form id="emailPrivateLink">' +
|
||||||
' <input id="email" class="hidden" value="" placeholder="{{mailPrivatePlaceholder}}" type="text" />' +
|
' <input id="email" class="hidden" value="" placeholder="{{mailPrivatePlaceholder}}" type="text" />' +
|
||||||
' <input id="emailButton" class="hidden" type="submit" value="{{mailButtonText}}" />' +
|
' <input id="emailButton" class="hidden" type="submit" value="{{mailButtonText}}" />' +
|
||||||
' </form>' +
|
'</form>' +
|
||||||
' {{/if}}' +
|
' {{/if}}' +
|
||||||
'</div>'
|
'{{else}}' +
|
||||||
|
'<input id="shareWith" type="text" placeholder="{{noSharingPlaceholder}}" disabled="disabled"/>' +
|
||||||
|
'{{/if}}'
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,11 +90,17 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
var linkShareTemplate = this.template();
|
||||||
|
|
||||||
if( !this.model.hasSharePermission()
|
if( !this.model.hasSharePermission()
|
||||||
|| !this.showLink
|
|| !this.showLink
|
||||||
|| !this.configModel.isShareWithLinkAllowed())
|
|| !this.configModel.isShareWithLinkAllowed())
|
||||||
{
|
{
|
||||||
this.$el.empty();
|
this.$el.empty();
|
||||||
|
this.$el.append(linkShareTemplate({
|
||||||
|
shareAllowed: false,
|
||||||
|
noSharingPlaceholder: t('core', 'Resharing is not allowed')
|
||||||
|
}));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,9 +114,9 @@
|
||||||
publicUploadChecked = 'checked="checked"';
|
publicUploadChecked = 'checked="checked"';
|
||||||
}
|
}
|
||||||
|
|
||||||
var linkShareTemplate = this.template();
|
|
||||||
this.$el.empty();
|
this.$el.empty();
|
||||||
this.$el.append(linkShareTemplate({
|
this.$el.append(linkShareTemplate({
|
||||||
|
shareAllowed: true,
|
||||||
linkShareLabel: t('core', 'Share link'),
|
linkShareLabel: t('core', 'Share link'),
|
||||||
urlLabel: t('core', 'Link'),
|
urlLabel: t('core', 'Link'),
|
||||||
enablePasswordLabel: t('core', 'Password protect'),
|
enablePasswordLabel: t('core', 'Password protect'),
|
||||||
|
|
|
@ -24,11 +24,7 @@
|
||||||
'{{{remoteShareInfo}}}' +
|
'{{{remoteShareInfo}}}' +
|
||||||
'<ul id="shareWithList">' +
|
'<ul id="shareWithList">' +
|
||||||
'</ul>' +
|
'</ul>' +
|
||||||
'{{#if shareAllowed}}' +
|
|
||||||
'<div class="linkShareView"></div>' +
|
'<div class="linkShareView"></div>' +
|
||||||
'{{else}}' +
|
|
||||||
'{{{noSharing}}}' +
|
|
||||||
'{{/if}}' +
|
|
||||||
'<div class="expirationView"></div>'
|
'<div class="expirationView"></div>'
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -114,20 +110,16 @@
|
||||||
shareLabel: t('core', 'Share'),
|
shareLabel: t('core', 'Share'),
|
||||||
sharePlaceholder: this._renderSharePlaceholderPart(),
|
sharePlaceholder: this._renderSharePlaceholderPart(),
|
||||||
remoteShareInfo: this._renderRemoteShareInfoPart(),
|
remoteShareInfo: this._renderRemoteShareInfoPart(),
|
||||||
shareAllowed: this.model.hasSharePermission(),
|
|
||||||
noSharing: this._renderNoSharing(),
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.resharerInfoView.$el = this.$el.find('.resharerInfoView');
|
this.resharerInfoView.$el = this.$el.find('.resharerInfoView');
|
||||||
this.resharerInfoView.render();
|
this.resharerInfoView.render();
|
||||||
|
|
||||||
this.expirationView.$el = this.$el.find('.expirationView');
|
|
||||||
this.expirationView.render();
|
|
||||||
|
|
||||||
if(this.model.hasSharePermission()) {
|
|
||||||
this.linkShareView.$el = this.$el.find('.linkShareView');
|
this.linkShareView.$el = this.$el.find('.linkShareView');
|
||||||
this.linkShareView.render();
|
this.linkShareView.render();
|
||||||
}
|
|
||||||
|
this.expirationView.$el = this.$el.find('.expirationView');
|
||||||
|
this.expirationView.render();
|
||||||
|
|
||||||
this.$el.find('.hasTooltip').tooltip();
|
this.$el.find('.hasTooltip').tooltip();
|
||||||
if(this.configModel.areAvatarsEnabled()) {
|
if(this.configModel.areAvatarsEnabled()) {
|
||||||
|
@ -169,17 +161,6 @@
|
||||||
return sharePlaceholder;
|
return sharePlaceholder;
|
||||||
},
|
},
|
||||||
|
|
||||||
_renderNoSharing: function () {
|
|
||||||
var noSharing = '';
|
|
||||||
if(!this.model.hasSharePermission()) {
|
|
||||||
var noSharingTemplate = this._getTemplate('noSharing', TEMPLATE_NO_SHARING);
|
|
||||||
noSharing = noSharingTemplate({
|
|
||||||
placeholder: t('core', 'Resharing is not allowed')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return noSharing;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} key - an identifier for the template
|
* @param {string} key - an identifier for the template
|
||||||
|
|
Loading…
Reference in New Issue