Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to create multiple link shares via share api #11844

Merged
merged 14 commits into from
Nov 1, 2018
Merged
Prev Previous commit
Next Next commit
Fix password enforcement
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv authored and danxuliu committed Nov 1, 2018
commit a7ea3d29fa6baedb47e2a2f6677c7e0d166b6436
17 changes: 12 additions & 5 deletions core/js/share/sharedialoglinkshareview.handlebars
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{{#if shareAllowed}}
<ul id="shareLink" class="shareWithList">
<ul class="shareWithList">
{{#if nolinkShares}}
<li>
<li data-share-id="new-share">
<div class="avatar icon-public-white"></div>
<span class="username">{{newShareLabel}}</span>
<span class="sharingOptionsGroup">
<span class="icon icon-add new-share has-tooltip" title="{{newShareTitle}}"></span>
<span class="icon icon-loading-small hidden"></span>
<div class="share-menu">
<a href="#" class="icon icon-add new-share has-tooltip {{#if showPending}}hidden{{/if}}" title="{{newShareTitle}}"></a>
<span class="icon icon-loading-small {{#unless showPending}}hidden{{/unless}}"></span>
{{#if showPending}}
{{{pendingPopoverMenu}}}
{{/if}}
</div>
</span>
</li>
{{/if}}
@@ -16,7 +21,9 @@

<span class="sharingOptionsGroup">
<a href="#" class="clipboard-button icon icon-clippy has-tooltip" data-clipboard-text="{{shareLinkURL}}" title="{{copyLabel}}"></a>
<div class="share-menu" tabindex="0"><span class="icon icon-more"></span>
<div class="share-menu">
<a href="#" class="icon icon-more {{#if showPending}}hidden{{/if}}"></a>
<span class="icon icon-loading-small {{#unless showPending}}hidden{{/unless}}"></span>
{{#if showPending}}
{{{pendingPopoverMenu}}}
{{else}}
18 changes: 9 additions & 9 deletions core/js/share/sharedialoglinkshareview_popover_menu.handlebars
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
</li>
{{#if showHideDownloadCheckbox}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<span class="icon-loading-small hidden"></span>
<input type="checkbox" name="hideDownload" id="sharingDialogHideDownload-{{cid}}" class="checkbox hideDownloadCheckbox"
{{#if hideDownload}}checked="checked"{{/if}} />
@@ -24,20 +24,20 @@
{{/if}}
{{#if publicUpload}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<span class="icon-loading-small hidden"></span>
<input type="radio" name="publicUpload" value="{{publicUploadRValue}}" id="sharingDialogAllowPublicUpload-r-{{cid}}" class="radio publicUploadRadio" {{{publicUploadRChecked}}} />
<label for="sharingDialogAllowPublicUpload-r-{{cid}}">{{publicUploadRLabel}}</label>
</span>
</li>
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<span class="icon-loading-small hidden"></span>
<input type="radio" name="publicUpload" value="{{publicUploadRWValue}}" id="sharingDialogAllowPublicUpload-rw-{{cid}}" class="radio publicUploadRadio" {{{publicUploadRWChecked}}} />
<label for="sharingDialogAllowPublicUpload-rw-{{cid}}">{{publicUploadRWLabel}}</label>
</span></li>
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<span class="icon-loading-small hidden"></span>
<input type="radio" name="publicUpload" value="{{publicUploadWValue}}" id="sharingDialogAllowPublicUpload-w-{{cid}}" class="radio publicUploadRadio" {{{publicUploadWChecked}}} />
<label for="sharingDialogAllowPublicUpload-w-{{cid}}">{{publicUploadWLabel}}</label>
@@ -46,7 +46,7 @@
{{/if}}
{{#if publicEditing}}
<li id="allowPublicEditingWrapper">
<span class="shareOption menuitem">
<span class="menuitem">
<span class="icon-loading-small hidden"></span>
<input type="checkbox" name="allowPublicEditing" id="sharingDialogAllowPublicEditing-{{cid}}" class="checkbox publicEditingCheckbox" {{{publicEditingChecked}}} />
<label for="sharingDialogAllowPublicEditing-{{cid}}">{{publicEditingLabel}}</label>
@@ -55,21 +55,21 @@
{{/if}}
{{#if showPasswordCheckBox}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input type="checkbox" name="showPassword" id="showPassword-{{cid}}" class="checkbox showPasswordCheckbox"
{{#if isPasswordSet}}checked="checked"{{/if}} {{#if isPasswordEnforced}}disabled="disabled"{{/if}} value="1" />
<label for="showPassword-{{cid}}">{{enablePasswordLabel}}</label>
</span>
</li>
<li class="{{#unless isPasswordSet}}hidden{{/unless}} linkPassMenu">
<span class="shareOption menuitem icon-share-pass">
<span class="menuitem icon-share-pass">
<input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" autocomplete="new-password" />
<span class="icon icon-loading-small hidden"></span>
</span>
</li>
{{/if}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="expireDate-{{cid}}" type="checkbox" name="expirationDate" class="expireDate checkbox"
{{#if hasExpireDate}}checked="checked"{{/if}} {{#if isExpirationEnforced}}disabled="disabled"{{/if}} />
<label for="expireDate-{{cid}}">{{expireDateLabel}}</label>
@@ -100,7 +100,7 @@
</li>
{{#each social}}
<li>
<a href="#" class="shareOption menuitem pop-up" data-url="{{url}}" data-window="{{newWindow}}">
<a href="#" class="menuitem pop-up" data-url="{{url}}" data-window="{{newWindow}}">
<span class="icon {{iconClass}}"></span>
<span>{{label}}</span>
</a>
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<div class="popovermenu pendingpopover menu">
<div class="popovermenu open menu">
<ul>
{{#if isPasswordEnforced}}
<li><span class="shareOption menuitem">
<input type="checkbox" name="showPassword" id="showPassword-{{cid}}" checked="checked" disabled class="checkbox showPasswordCheckbox" value="1" />
<label for="showPassword-{{cid}}">{{enablePasswordLabel}}</label>
</span></li>
<li class="linkPassMenu"><span class="shareOption menuitem icon-share-pass">
<input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" autocomplete="new-password" />
<span class="icon icon-loading-small hidden"></span>
</span></li>
<li>
<span class="menuitem icon-info">
<p>{{enforcedPasswordLabel}}</p>
</span>
</li>
<li class="linkPassMenu">
<span class="menuitem">
<form autocomplete="off" class="enforcedPassForm">
<input id="enforcedPassText" required class="enforcedPassText" type="password"
placeholder="{{passwordPlaceholder}}" autocomplete="new-password" minlength="4" />
<input type="submit" value=" " class="primary icon-checkmark-white">
</form>
</span>
</li>
{{/if}}
</ul>
</div>
2 changes: 1 addition & 1 deletion core/js/share/sharedialogshareelistview.handlebars
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<span class="username" title="{{shareWithTitle}}">{{shareWithDisplayName}}</span>
<span class="sharingOptionsGroup">
{{#if editPermissionPossible}}
<span class="shareOption">
<span>
<input id="canEdit-{{cid}}-{{shareId}}" type="checkbox" name="edit" class="permissions checkbox" />
<label for="canEdit-{{cid}}-{{shareId}}">{{canEditLabel}}</label>
</span>
16 changes: 8 additions & 8 deletions core/js/share/sharedialogshareelistview_popover_menu.handlebars
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<ul>
{{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isMailShare}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="canShare-{{cid}}-{{shareId}}" type="checkbox" name="share" class="permissions checkbox" {{#if hasSharePermission}}checked="checked"{{/if}} data-permissions="{{sharePermission}}" />
<label for="canShare-{{cid}}-{{shareId}}">{{canShareLabel}}</label>
</span>
@@ -11,23 +11,23 @@
{{#if isFolder}}
{{#if createPermissionPossible}}{{#unless isMailShare}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="canCreate-{{cid}}-{{shareId}}" type="checkbox" name="create" class="permissions checkbox" {{#if hasCreatePermission}}checked="checked"{{/if}} data-permissions="{{createPermission}}"/>
<label for="canCreate-{{cid}}-{{shareId}}">{{createPermissionLabel}}</label>
</span>
</li>
{{/unless}}{{/if}}
{{#if updatePermissionPossible}}{{#unless isMailShare}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="canUpdate-{{cid}}-{{shareId}}" type="checkbox" name="update" class="permissions checkbox" {{#if hasUpdatePermission}}checked="checked"{{/if}} data-permissions="{{updatePermission}}"/>
<label for="canUpdate-{{cid}}-{{shareId}}">{{updatePermissionLabel}}</label>
</span>
</li>
{{/unless}}{{/if}}
{{#if deletePermissionPossible}}{{#unless isMailShare}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="canDelete-{{cid}}-{{shareId}}" type="checkbox" name="delete" class="permissions checkbox" {{#if hasDeletePermission}}checked="checked"{{/if}} data-permissions="{{deletePermission}}"/>
<label for="canDelete-{{cid}}-{{shareId}}">{{deletePermissionLabel}}</label>
</span>
@@ -37,14 +37,14 @@
{{#if isMailShare}}
{{#if hasCreatePermission}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="secureDrop-{{cid}}-{{shareId}}" type="checkbox" name="secureDrop" class="checkbox secureDrop" {{#if secureDropMode}}checked="checked"{{/if}} data-permissions="{{readPermission}}"/>
<label for="secureDrop-{{cid}}-{{shareId}}">{{secureDropLabel}}</label>
</span>
</li>
{{/if}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="password-{{cid}}-{{shareId}}" type="checkbox" name="password" class="password checkbox" {{#if isPasswordSet}}checked="checked"{{/if}}{{#if isPasswordSet}}{{#if isPasswordForMailSharesRequired}}disabled=""{{/if}}{{/if}}" />
<label for="password-{{cid}}-{{shareId}}">{{passwordLabel}}</label>
</span>
@@ -58,7 +58,7 @@
</li>
{{#if isTalkEnabled}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="passwordByTalk-{{cid}}-{{shareId}}" type="checkbox" name="passwordByTalk" class="passwordByTalk checkbox" {{#if isPasswordByTalkSet}}checked="checked"{{/if}} />
<label for="passwordByTalk-{{cid}}-{{shareId}}">{{passwordByTalkLabel}}</label>
</span>
@@ -73,7 +73,7 @@
{{/if}}
{{/if}}
<li>
<span class="shareOption menuitem">
<span class="menuitem">
<input id="expireDate-{{cid}}-{{shareId}}" type="checkbox" name="expirationDate" class="expireDate checkbox" {{#if hasExpireDate}}checked="checked"{{/if}}" />
<label for="expireDate-{{cid}}-{{shareId}}">{{expireDateLabel}}</label>
</span>
Loading