diff --git a/seahub/templates/share_access_validation.html b/seahub/templates/share_access_validation.html index 4bb1afa265..eca807fdc8 100644 --- a/seahub/templates/share_access_validation.html +++ b/seahub/templates/share_access_validation.html @@ -5,9 +5,17 @@

{% trans "Please input the password if you want to browse the shared file/directory." %}

{% if path %} + {% if direct_download %} +
+ {% else %} + {% endif %} + {% else %} + {% if direct_download %} + {% else %} + {% endif %} {% endif %} {% csrf_token %} diff --git a/seahub/views/file.py b/seahub/views/file.py index ad9407b634..442ec98704 100644 --- a/seahub/views/file.py +++ b/seahub/views/file.py @@ -1109,8 +1109,10 @@ def view_shared_file(request, fileshare): # check if share link is encrypted password_check_passed, err_msg = check_share_link_common(request, fileshare) + direct_download = request.GET.get('dl', '') == '1' if not password_check_passed: - d = {'token': token, 'view_name': 'view_shared_file', 'err_msg': err_msg} + d = {'token': token, 'view_name': 'view_shared_file', + 'err_msg': err_msg, 'direct_download': direct_download} return render(request, 'share_access_validation.html', d) # recourse check