1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

[org repo] improvement

This commit is contained in:
llj
2015-04-22 11:02:07 +08:00
committed by Daniel Pan
parent be1e9762af
commit c77585f9a1
4 changed files with 8 additions and 9 deletions

View File

@@ -180,7 +180,7 @@ urlpatterns = patterns('',
## ajax lib
url(r'^ajax/lib/(?P<repo_id>[-0-9a-f]{36})/dir/$', list_lib_dir, name="list_lib_dir"),
url(r'^ajax/repo/unsetinnerpub/(?P<repo_id>[-0-9a-f]{36})/$', ajax_unsetinnerpub, name='unsetinnerpub'),
url(r'^ajax/unset-inner-pub-repo/(?P<repo_id>[-0-9a-f]{36})/$', ajax_unset_inner_pub_repo, name='ajax_unset_inner_pub_repo'),
### Organizaion ###
url(r'^pubinfo/libraries/$', pubrepo, name='pubrepo'),

View File

@@ -2507,7 +2507,7 @@ def toggle_personal_modules(request):
content_type=content_type)
@login_required_ajax
def ajax_unsetinnerpub(request, repo_id):
def ajax_unset_inner_pub_repo(request, repo_id):
"""
Unshare repos in organization.
@@ -2564,7 +2564,7 @@ def ajax_unsetinnerpub(request, repo_id):
send_perm_audit_msg('delete-repo-perm', username, 'all', \
perm_repo_id, perm_path, perm)
return HttpResponse(json.dumps({ "success": True }), content_type=content_type)
return HttpResponse(json.dumps({"success": True}), content_type=content_type)
except SearpcError:
return HttpResponse(json.dumps({ "success": False }),
return HttpResponse(json.dumps({"error": _('Internal server error')}),
status=500, content_type=content_type)

View File

@@ -37,7 +37,7 @@ define([
var el = this.$el;
Common.ajaxGet({
get_url: Common.getUrl({
name:'ajax_unsetinnerpub',
name: 'ajax_unset_inner_pub_repo',
repo_id: this.model.get('id')
}),
data: {
@@ -47,9 +47,7 @@ define([
el.remove();
Common.feedback(gettext('Success'), 'success', Common.SUCCESS_TIMOUT);
},
after_op_error: function() {
// TODO
}
after_op_error: Common.ajaxErrorHandler
});
}

View File

@@ -115,7 +115,8 @@ define([
case 'toggle_personal_modules': return siteRoot + 'ajax/toggle-personal-modules/';
case 'ajax_unsetinnerpub': return siteRoot + 'ajax/repo/unsetinnerpub/' + options.repo_id + '/';
case 'ajax_unset_inner_pub_repo': return siteRoot + 'ajax/unset-inner-pub-repo/' + options.repo_id + '/';
}
},