diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-08-21 20:29:12 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:26 +0200 |
commit | 6af6024e172bc4810691f54ccaa2da6912395962 (patch) | |
tree | df5b917f8d398becb1227052a6b95e7ab369d34e /core/js/sharedialoglinkshareview.js | |
parent | 8f3884145e3992ec5195d6bdd7c4c97926c0c582 (diff) | |
download | nextcloud-server-6af6024e172bc4810691f54ccaa2da6912395962.tar.gz nextcloud-server-6af6024e172bc4810691f54ccaa2da6912395962.zip |
integraton noshare part into ShareDialogLinkShareView
Diffstat (limited to 'core/js/sharedialoglinkshareview.js')
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index ccd705803f6..ca6413761b0 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -14,32 +14,34 @@ } var TEMPLATE = - '<div id="link" class="linkShare">' + + '{{#if shareAllowed}}' + + '<span class="icon-loading-small hidden"></span>' + + '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">{{linkShareLabel}}</label>' + + '<br />' + + '<label for="linkText" class="hidden-visually">{{urlLabel}}</label>' + + '<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>' + + '<div id="linkPass">' + + ' <label for="linkPassText" class="hidden-visually">{{passwordLabel}}</label>' + + ' <input id="linkPassText" type="password" placeholder="passwordPlaceholder" />' + ' <span class="icon-loading-small hidden"></span>' + - ' <input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">{{linkShareLabel}}</label>' + - ' <br />' + - ' <label for="linkText" class="hidden-visually">{{urlLabel}}</label>' + - ' <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>' + - ' <div id="linkPass">' + - ' <label for="linkPassText" class="hidden-visually">{{passwordLabel}}</label>' + - ' <input id="linkPassText" type="password" placeholder="passwordPlaceholder" />' + - ' <span class="icon-loading-small hidden"></span>' + - ' </div>' + + '</div>' + ' {{#if publicUpload}}' + - ' <div id="allowPublicUploadWrapper" class="hidden">' + - ' <span class="icon-loading-small hidden"></span>' + - ' <input type="checkbox" value="1" name="allowPublicUpload" id="sharingDialogAllowPublicUpload" {{{publicUploadChecked}}} />' + - ' <label for="sharingDialogAllowPublicUpload">{{publicUploadLabel}}</label>' + - ' </div>' + + '<div id="allowPublicUploadWrapper" class="hidden">' + + ' <span class="icon-loading-small hidden"></span>' + + ' <input type="checkbox" value="1" name="allowPublicUpload" id="sharingDialogAllowPublicUpload" {{{publicUploadChecked}}} />' + + ' <label for="sharingDialogAllowPublicUpload">{{publicUploadLabel}}</label>' + + '</div>' + ' {{/if}}' + ' {{#if mailPublicNotificationEnabled}}' + - ' <form id="emailPrivateLink">' + - ' <input id="email" class="hidden" value="" placeholder="{{mailPrivatePlaceholder}}" type="text" />' + - ' <input id="emailButton" class="hidden" type="submit" value="{{mailButtonText}}" />' + - ' </form>' + + '<form id="emailPrivateLink">' + + ' <input id="email" class="hidden" value="" placeholder="{{mailPrivatePlaceholder}}" type="text" />' + + ' <input id="emailButton" class="hidden" type="submit" value="{{mailButtonText}}" />' + + '</form>' + ' {{/if}}' + - '</div>' + '{{else}}' + + '<input id="shareWith" type="text" placeholder="{{noSharingPlaceholder}}" disabled="disabled"/>' + + '{{/if}}' ; /** @@ -88,11 +90,17 @@ }, render: function() { + var linkShareTemplate = this.template(); + if( !this.model.hasSharePermission() || !this.showLink || !this.configModel.isShareWithLinkAllowed()) { this.$el.empty(); + this.$el.append(linkShareTemplate({ + shareAllowed: false, + noSharingPlaceholder: t('core', 'Resharing is not allowed') + })); return this; } @@ -106,9 +114,9 @@ publicUploadChecked = 'checked="checked"'; } - var linkShareTemplate = this.template(); this.$el.empty(); this.$el.append(linkShareTemplate({ + shareAllowed: true, linkShareLabel: t('core', 'Share link'), urlLabel: t('core', 'Link'), enablePasswordLabel: t('core', 'Password protect'), |