diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-03 15:53:17 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:27 +0200 |
commit | ce1b0c650e3a0e4cb701609ee08a13182909219a (patch) | |
tree | 917a0b27ab41898fbc37861909489824f49f3392 /core/js/sharedialoglinkshareview.js | |
parent | 5dc2c35ce5f3023ccea4cc599cf54d6b1c0e2c01 (diff) | |
download | nextcloud-server-ce1b0c650e3a0e4cb701609ee08a13182909219a.tar.gz nextcloud-server-ce1b0c650e3a0e4cb701609ee08a13182909219a.zip |
show link share
Diffstat (limited to 'core/js/sharedialoglinkshareview.js')
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index eebf8a34247..373d6d180bc 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -16,16 +16,20 @@ var TEMPLATE = '{{#if shareAllowed}}' + '<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" {{#if isLinkShare}}checked="checked"{{/if}} /><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>' + + '<input id="linkText" {{#unless isLinkShare}}class="hidden"{{/unless}} type="text" readonly="readonly" value="{{shareLinkURL}}" />' + + ' {{#if showPasswordCheckBox}}' + + '<input type="checkbox" name="showPassword" id="showPassword" {{#if isPasswordSet}}checked="checked"{{/if}} value="1" /><label for="showPassword">{{enablePasswordLabel}}</label>' + + ' {{/if}}' + + ' {{#if isPasswordSet}}' + '<div id="linkPass">' + ' <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>' + '</div>' + + ' {{/if}}' + ' {{#if publicUpload}}' + '<div id="allowPublicUploadWrapper" class="hidden">' + ' <span class="icon-loading-small hidden"></span>' + @@ -35,8 +39,8 @@ ' {{/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}}" />' + + ' <input id="email" value="" placeholder="{{mailPrivatePlaceholder}}" type="text" />' + + ' <input id="emailButton" type="submit" value="{{mailButtonText}}" />' + '</form>' + ' {{/if}}' + '{{else}}' + @@ -113,17 +117,27 @@ publicUploadChecked = 'checked="checked"'; } + var isLinkShare = this.model.get('linkShare').isLinkShare; + var isPasswordSet = !!this.model.get('linkShare').password; + var showPasswordCheckBox = isLinkShare + && ( !this.configModel.get('enforcePasswordForPublicLink') + || !this.model.get('linkShare').password); + this.$el.html(linkShareTemplate({ shareAllowed: true, + isLinkShare: isLinkShare, + shareLinkURL: this.model.get('linkShare').link, linkShareLabel: t('core', 'Share link'), urlLabel: t('core', 'Link'), enablePasswordLabel: t('core', 'Password protect'), passwordLabel: t('core', 'Password'), - passwordPlaceholder: t('core', 'Choose a password for the public link'), - publicUpload: publicUpload, + passwordPlaceholder: isPasswordSet ? '**********' : t('core', 'Choose a password for the public link'), + isPasswordSet: isPasswordSet, + showPasswordCheckBox: showPasswordCheckBox, + publicUpload: publicUpload && isLinkShare, publicUploadChecked: publicUploadChecked, publicUploadLabel: t('core', 'Allow editing'), - mailPublicNotificationEnabled: this.configModel.isMailPublicNotificationEnabled(), + mailPublicNotificationEnabled: isLinkShare && this.configModel.isMailPublicNotificationEnabled(), mailPrivatePlaceholder: t('core', 'Email link to person'), mailButtonText: t('core', 'Send') })); |