diff --git a/seahub/templates/js/lib-op-popups.html b/seahub/templates/js/lib-op-popups.html index e337c8c210..ab53a05626 100644 --- a/seahub/templates/js/lib-op-popups.html +++ b/seahub/templates/js/lib-op-popups.html @@ -112,6 +112,7 @@

<%= title %>

{% trans "A file with the same name already exists in this folder." %}
{% trans "Replacing it will overwrite its content." %}

+

diff --git a/static/scripts/app/views/fileupload.js b/static/scripts/app/views/fileupload.js index 216f4425fd..de2c91f333 100644 --- a/static/scripts/app/views/fileupload.js +++ b/static/scripts/app/views/fileupload.js @@ -214,8 +214,14 @@ define([ }); $('#simplemodal-container').css({'height':'auto'}); $('.yes', confirm_popup).click(function() { - file.choose_to_update = true; - $.modal.close(); + var selected_file = dirents.findWhere({'obj_name': file.name}); + if (selected_file.get('is_locked')) { + $('.error', confirm_popup).html(gettext("File is locked")).removeClass('hide'); + Common.disableButton($(this)); + } else { + file.choose_to_update = true; + $.modal.close(); + } }); $('.no', confirm_popup).click(function() { file.choose_to_upload = true;