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:
@@ -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>
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user