1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 21:07:17 +00:00
Files
seahub/seahub/templates/sysadmin/sys_org_set_quota_js.html
2014-10-22 10:10:58 +08:00

42 lines
1.1 KiB
HTML

{% load i18n%}
$('#set-quota').click(function() {
$("#set-quota-form").modal({appendTo: "#main"});
return false;
});
$('#set-quota-form .submit').click(function() {
var form = $('#set-quota-form'),
form_id = form.attr('id');
var quota = $('input[name="quota"]', form).val();
if (!$.trim(quota)) {
apply_form_error(form_id, "{% trans "Quota can not be empty" %}");
return false;
}
var sb_btn = $(this);
disable(sb_btn);
$.ajax({
url: '{% url 'sys_org_set_quota' org.org_id %}',
type: 'POST',
dataType: 'json',
cache: 'false',
beforeSend: prepareCSRFToken,
data: {
'quota': quota
},
success: function(data) {
location.reload(true);
},
error: function(xhr, textStatus, errorThrown) {
if (xhr.responseText) {
apply_form_error(form_id, $.parseJSON(xhr.responseText).error);
} else {
apply_form_error(form_id, "{% trans "Failed. Please check the network." %}");
}
enable(sb_btn);
}
});
return false;
});