1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

check file lock before update a file

This commit is contained in:
lian
2015-07-20 17:36:12 +08:00
parent 3ec770e7d8
commit 2d34cb611a
2 changed files with 9 additions and 2 deletions

View File

@@ -112,6 +112,7 @@
<div>
<h3><%= title %></h3>
<p>{% trans "A file with the same name already exists in this folder." %}<br />{% trans "Replacing it will overwrite its content." %}</p>
<p class="error hide"></p>
<button class="yes btn">{% trans "Replace" %}</button>
<button class="no btn" style="margin-left:5px;">{% trans "Don't replace" %}</button>
<button class="simplemodal-close btn">{% trans "Cancel" %}</button>

View File

@@ -214,8 +214,14 @@ define([
});
$('#simplemodal-container').css({'height':'auto'});
$('.yes', confirm_popup).click(function() {
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;