1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

[lib] modified file/dir mv/cp and other improvement & bugfix

This commit is contained in:
llj
2015-02-06 14:25:36 +08:00
committed by Daniel Pan
parent 86fc129add
commit 11779c91bc
7 changed files with 235 additions and 72 deletions

View File

@@ -836,9 +836,7 @@ def mv_file(src_repo_id, src_path, dst_repo_id, dst_path, obj_name, username):
content_type=content_type)
result['success'] = True
msg_url = reverse('repo', args=[dst_repo_id]) + '?p=' + urlquote(dst_path)
msg = _(u'Successfully moved %(name)s <a href="%(url)s">view</a>') % \
{"name":escape(obj_name), "url":msg_url}
msg = _(u'Successfully moved %(name)s') % {"name": escape(obj_name)}
result['msg'] = msg
if res.background:
result['task_id'] = res.task_id
@@ -865,9 +863,7 @@ def cp_file(src_repo_id, src_path, dst_repo_id, dst_path, obj_name, username):
content_type=content_type)
result['success'] = True
msg_url = reverse('repo', args=[dst_repo_id]) + '?p=' + urlquote(dst_path)
msg = _(u'Successfully copied %(name)s <a href="%(url)s">view</a>') % \
{"name":escape(obj_name), "url":msg_url}
msg = _(u'Successfully copied %(name)s') % {"name":escape(obj_name)}
result['msg'] = msg
if res.background:
@@ -912,9 +908,7 @@ def mv_dir(src_repo_id, src_path, dst_repo_id, dst_path, obj_name, username):
content_type=content_type)
result['success'] = True
msg_url = reverse('repo', args=[dst_repo_id]) + '?p=' + urlquote(dst_path)
msg = _(u'Successfully moved %(name)s <a href="%(url)s">view</a>') % \
{"name":escape(obj_name), "url":msg_url}
msg = _(u'Successfully moved %(name)s') % {"name":escape(obj_name)}
result['msg'] = msg
if res.background:
result['task_id'] = res.task_id
@@ -957,9 +951,7 @@ def cp_dir(src_repo_id, src_path, dst_repo_id, dst_path, obj_name, username):
content_type=content_type)
result['success'] = True
msg_url = reverse('repo', args=[dst_repo_id]) + '?p=' + urlquote(dst_path)
msg = _(u'Successfully copied %(name)s <a href="%(url)s">view</a>') % \
{"name":escape(obj_name), "url":msg_url}
msg = _(u'Successfully copied %(name)s') % {"name":escape(obj_name)}
result['msg'] = msg
if res.background:
result['task_id'] = res.task_id
@@ -2209,7 +2201,7 @@ def ajax_repo_change_passwd(request, repo_id):
}), status=400, content_type=content_type)
messages.success(request, _(u'Successfully updated the password of Library %(repo_name)s.') %
{'repo_name': repo.name})
{'repo_name': escape(repo.name)})
return HttpResponse(json.dumps({'success': True}),
content_type=content_type)