mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 21:30:39 +00:00
[dir view] enable read-only dirents in non-encrypted libs to be copied into other libs
This commit is contained in:
@@ -43,9 +43,11 @@
|
|||||||
<form id="mv-form" action="" method="post" class="file-choose-form hide">{% csrf_token %}
|
<form id="mv-form" action="" method="post" class="file-choose-form hide">{% csrf_token %}
|
||||||
<h3><%= form_title %></h3>
|
<h3><%= form_title %></h3>
|
||||||
<div id="mv-dir-list" class="dir-tree-cont">
|
<div id="mv-dir-list" class="dir-tree-cont">
|
||||||
|
<% if (show_cur_repo) { %>
|
||||||
<h5 class="hd cspt"><span class="icon-caret-down"></span>{% trans "Current Library"%}</h5>
|
<h5 class="hd cspt"><span class="icon-caret-down"></span>{% trans "Current Library"%}</h5>
|
||||||
<span class="loading-icon loading-tip"></span>
|
<span class="loading-icon loading-tip"></span>
|
||||||
<div id="current-repo-dirs"></div>
|
<div id="current-repo-dirs"></div>
|
||||||
|
<% } %>
|
||||||
<% if (show_other_repos) { %>
|
<% if (show_other_repos) { %>
|
||||||
<div id="other-repos">
|
<div id="other-repos">
|
||||||
<h5 class="hd cspt"><span class="icon-caret-right"></span>{% trans "Other Libraries"%}</h5>
|
<h5 class="hd cspt"><span class="icon-caret-right"></span>{% trans "Other Libraries"%}</h5>
|
||||||
|
@@ -234,6 +234,11 @@
|
|||||||
<li><a class="op open-via-client" href="seafile://openfile?repo_id=<%- repo_id %>&path=<% print(encodeURIComponent(dirent_path + '/')); %>">{% trans "Open via Client" %}</a></li>
|
<li><a class="op open-via-client" href="seafile://openfile?repo_id=<%- repo_id %>&path=<% print(encodeURIComponent(dirent_path + '/')); %>">{% trans "Open via Client" %}</a></li>
|
||||||
<% } %>
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
|
<% } else if (dirent.perm == 'r' && !repo_encrypted) { %>
|
||||||
|
<span class="more-op-icon sf2-icon-caret-down op-icon" title="{% trans "More operations" %}"></span>
|
||||||
|
<ul class="hidden-op hide">
|
||||||
|
<li><a class="op cp" href="#">{% trans "Copy" %}</a></li>
|
||||||
|
</ul>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -316,6 +321,11 @@
|
|||||||
<li><a class="op open-via-client" href="seafile://openfile?repo_id=<%- repo_id %>&path=<% print(encodeURIComponent(dirent_path)); %>">{% trans "Open via Client" %}</a></li>
|
<li><a class="op open-via-client" href="seafile://openfile?repo_id=<%- repo_id %>&path=<% print(encodeURIComponent(dirent_path)); %>">{% trans "Open via Client" %}</a></li>
|
||||||
<% } %>
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
|
<% } else if (dirent.perm == 'r' && !repo_encrypted) { %>
|
||||||
|
<span class="more-op-icon sf2-icon-caret-down op-icon" title="{% trans "More operations" %}"></span>
|
||||||
|
<ul class="hidden-op hide">
|
||||||
|
<li><a class="op cp" href="#">{% trans "Copy" %}</a></li>
|
||||||
|
</ul>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@@ -308,21 +308,28 @@ define([
|
|||||||
var title = op_type == 'mv' ? gettext("Move {placeholder} to:") : gettext("Copy {placeholder} to:");
|
var title = op_type == 'mv' ? gettext("Move {placeholder} to:") : gettext("Copy {placeholder} to:");
|
||||||
title = title.replace('{placeholder}', '<span class="op-target ellipsis ellipsis-op-target" title="' + Common.HTMLescape(obj_name) + '">' + Common.HTMLescape(obj_name) + '</span>');
|
title = title.replace('{placeholder}', '<span class="op-target ellipsis ellipsis-op-target" title="' + Common.HTMLescape(obj_name) + '">' + Common.HTMLescape(obj_name) + '</span>');
|
||||||
|
|
||||||
|
var show_cur_repo = true;
|
||||||
|
if (this.model.get('perm') == 'r') {
|
||||||
|
show_cur_repo = false;
|
||||||
|
}
|
||||||
var form = $(this.mvcpTemplate({
|
var form = $(this.mvcpTemplate({
|
||||||
form_title: title,
|
form_title: title,
|
||||||
op_type: op_type,
|
op_type: op_type,
|
||||||
obj_type: obj_type,
|
obj_type: obj_type,
|
||||||
obj_name: obj_name,
|
obj_name: obj_name,
|
||||||
show_other_repos: !dir.encrypted,
|
show_cur_repo: show_cur_repo,
|
||||||
|
show_other_repos: !dir.encrypted
|
||||||
}));
|
}));
|
||||||
form.modal({appendTo:'#main', autoResize:true, focus:false});
|
form.modal({appendTo:'#main', autoResize:true, focus:false});
|
||||||
$('#simplemodal-container').css({'width':'auto', 'height':'auto'});
|
$('#simplemodal-container').css({'width':'auto', 'height':'auto'});
|
||||||
|
|
||||||
FileTree.renderTreeForPath({
|
if (show_cur_repo) {
|
||||||
repo_name: dir.repo_name,
|
FileTree.renderTreeForPath({
|
||||||
repo_id: dir.repo_id,
|
repo_name: dir.repo_name,
|
||||||
path: dir.path
|
repo_id: dir.repo_id,
|
||||||
});
|
path: dir.path
|
||||||
|
});
|
||||||
|
}
|
||||||
if (!dir.encrypted) {
|
if (!dir.encrypted) {
|
||||||
FileTree.prepareOtherReposTree({cur_repo_id: dir.repo_id});
|
FileTree.prepareOtherReposTree({cur_repo_id: dir.repo_id});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user