mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-18 00:00:00 +00:00
[sub lib] bugfix for 'create' & 'dir op bar'
This commit is contained in:
@@ -140,7 +140,7 @@
|
|||||||
<% if (user_perm == 'rw') { %>
|
<% if (user_perm == 'rw') { %>
|
||||||
<a class="repo-trash-icon fright" href="<%= site_root %>repo/recycle/<%- repo_id %>/" target="_blank" title="{% trans 'Trash' %}"></a>
|
<a class="repo-trash-icon fright" href="<%= site_root %>repo/recycle/<%- repo_id %>/" target="_blank" title="{% trans 'Trash' %}"></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (is_repo_owner) { %>
|
<% if (is_repo_owner && !is_virtual) { %>
|
||||||
<a class="repo-setting-icon fright" href="<%= site_root %>repo/<%- repo_id %>/settings/" target="_blank" title="{% trans 'Settings' %}"></a>
|
<a class="repo-setting-icon fright" href="<%= site_root %>repo/<%- repo_id %>/settings/" target="_blank" title="{% trans 'Settings' %}"></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
@@ -263,16 +263,16 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
renderDirOpBar: function() {
|
renderDirOpBar: function() {
|
||||||
var dir = this.dir,
|
var dir = this.dir;
|
||||||
user_perm = dir.user_perm;
|
|
||||||
|
|
||||||
this.$dir_op_bar.html($.trim(this.dir_op_bar_template({
|
this.$dir_op_bar.html($.trim(this.dir_op_bar_template({
|
||||||
user_perm: user_perm,
|
user_perm: dir.user_perm,
|
||||||
encrypted: dir.encrypted,
|
encrypted: dir.encrypted,
|
||||||
path: dir.path,
|
path: dir.path,
|
||||||
repo_id: dir.repo_id,
|
repo_id: dir.repo_id,
|
||||||
site_root: app.pageOptions.site_root,
|
site_root: app.pageOptions.site_root,
|
||||||
is_repo_owner: dir.is_repo_owner,
|
is_repo_owner: dir.is_repo_owner,
|
||||||
|
is_virtual: dir.is_virtual,
|
||||||
enable_upload_folder: app.pageOptions.enable_upload_folder
|
enable_upload_folder: app.pageOptions.enable_upload_folder
|
||||||
})));
|
})));
|
||||||
},
|
},
|
||||||
|
@@ -142,18 +142,19 @@ define([
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$.modal.close();
|
$.modal.close();
|
||||||
|
var new_sub_lib = {
|
||||||
|
'id': data["sub_repo_id"],
|
||||||
|
'name': data["name"],
|
||||||
|
'origin_repo_id': ori_repo_id,
|
||||||
|
'origin_path': path,
|
||||||
|
'abbrev_origin_path': data["abbrev_origin_path"],
|
||||||
|
'mtime': new Date().getTime() / 1000,
|
||||||
|
'mtime_relative': gettext("Just now")
|
||||||
|
};
|
||||||
if (_this.repos.length > 0) {
|
if (_this.repos.length > 0) {
|
||||||
_this.repos.add({
|
_this.repos.add(new_sub_lib , {prepend: true});
|
||||||
'id': data["sub_repo_id"],
|
|
||||||
'name': data["name"],
|
|
||||||
'origin_repo_id': ori_repo_id,
|
|
||||||
'origin_path': path,
|
|
||||||
'abbrev_origin_path': data["abbrev_origin_path"],
|
|
||||||
'mtime': new Date().getTime() / 1000,
|
|
||||||
'mtime_relative': gettext("Just now")
|
|
||||||
}, {prepend: true});
|
|
||||||
} else {
|
} else {
|
||||||
_this.showMyRepos();
|
_this.repos.reset([new_sub_lib]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr, textStatus, errorThrown) {
|
error: function(xhr, textStatus, errorThrown) {
|
||||||
|
Reference in New Issue
Block a user