@@ -347,9 +347,15 @@ def invite_share_link_form(configuration, client_id, share_dict, output_format,
347
347
<h4>Send Share Link Invitations</h4>
348
348
<p>
349
349
After creating a share link you can manually give the link to anyone
350
- you want to share the data with and/or use this form to send
351
- invitations on email. Please note that abuse of this service to send
352
- out spam mail is strictly prohibited and will be sanctioned.
350
+ you want to share the data with. Either by handing them the URL<br/>
351
+ %(share_url)s<br/>
352
+ or by letting them scan this QR code:
353
+ </p>
354
+ <canvas id="sharelink_qr"><!-- filled by script --></canvas>
355
+ <p>
356
+ Alternatively you can use this form to send invitations on email.
357
+ Please note that abuse of this service to send out spam mail is
358
+ strictly prohibited and will be sanctioned.
353
359
</p>
354
360
<table>
355
361
<tr><td colspan=2>
@@ -389,6 +395,19 @@ def invite_share_link_form(configuration, client_id, share_dict, output_format,
389
395
''' % fill_helpers
390
396
return html
391
397
398
+ def show_share_link_qr (configuration , share_id ):
399
+ """Generate QR code for sharelinks"""
400
+ fill_helpers = {}
401
+ fill_helpers ['share_url' ] = "%s/sharelink/%s" % \
402
+ (configuration .migserver_https_sid_url ,
403
+ share_id )
404
+ return '''
405
+ var qr = new QRious({
406
+ element: document.getElementById("sharelink_qr"),
407
+ value: "%(share_url)s",
408
+ size: 200
409
+ });
410
+ ''' % fill_helpers
392
411
393
412
def load_share_links (configuration , client_id ):
394
413
"""Find all share links owned by user"""
0 commit comments