Commit adb16950 by Dányi Bence

webui: group management js interactions added

parent f4aad11e
......@@ -168,6 +168,35 @@ $(function() {
}
$('#new-member').click(function() {
$('#new-member-form').toggle();
});
$('#new-member-form input').click(function(e){
e.stopPropagation();
});
$('#new-member-form input[type=submit]').click(function(){
var neptun=$(this).prev().val();
$.ajax({
type: 'POST',
url: '/ajax/group/'+$(this).data('id')+'/add/',
data: 'neptun='+neptun,
dataType: 'json',
success: function(data){
window.location.reload();
}
}).error(function(data){
//TODO: fancy modal alert
alert(JSON.parse(data.responseText).status);
})
});
$('#group-members .remove').click(function(e){
e.preventDefault(); e.stopPropagation();
$.ajax({
type: 'POST',
url: '/ajax/group/'+$(this).data('gid')+'/remove/',
data: 'neptun='+$(this).data('neptun'),
success: function(data){
window.location.reload();
}
});
})
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment