|
|
|
@@ -10,32 +10,54 @@ $(document).on('turbolinks:load', function(){ |
|
|
|
|
|
|
|
// organizations open cla |
|
|
|
$('.organizations-list-container').on('click', '.open-cla-action', function(){ |
|
|
|
var $action = $(this); |
|
|
|
var $openClaAction = $(this); |
|
|
|
var $closeClaAction = $openClaAction.siblings('.close-cla-action'); |
|
|
|
|
|
|
|
var userId = $action.data('id'); |
|
|
|
$.ajax({ |
|
|
|
url: '/admins/organizations/' + userId + '/open_cla', |
|
|
|
method: 'POST', |
|
|
|
dataType: 'json', |
|
|
|
success: function() { |
|
|
|
showSuccessNotify(); |
|
|
|
var userId = $openClaAction.data('id'); |
|
|
|
customConfirm({ |
|
|
|
content: '确认开通吗?', |
|
|
|
ok: function () { |
|
|
|
$.ajax({ |
|
|
|
url: '/admins/organizations/' + userId + '/open_cla', |
|
|
|
method: 'POST', |
|
|
|
dataType: 'json', |
|
|
|
success: function() { |
|
|
|
showSuccessNotify(); |
|
|
|
$closeClaAction.show(); |
|
|
|
$openClaAction.hide(); |
|
|
|
}, |
|
|
|
error: function(res){ |
|
|
|
$.notify({ message: res.responseJSON.message }, { type: 'danger' }); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
// organizations close cla |
|
|
|
$('.organizations-list-container').on('click', '.close-cla-action', function(){ |
|
|
|
var $action = $(this); |
|
|
|
var $closeClaAction = $(this); |
|
|
|
var $openClaAction= $closeClaAction.siblings('.open-cla-action'); |
|
|
|
|
|
|
|
var userId = $action.data('id'); |
|
|
|
$.ajax({ |
|
|
|
url: '/admins/organizations/' + userId + '/close_cla', |
|
|
|
method: 'POST', |
|
|
|
dataType: 'json', |
|
|
|
success: function() { |
|
|
|
showSuccessNotify(); |
|
|
|
var userId = $openClaAction.data('id'); |
|
|
|
customConfirm({ |
|
|
|
content: '确认关闭吗?', |
|
|
|
ok: function () { |
|
|
|
$.ajax({ |
|
|
|
url: '/admins/organizations/' + userId + '/close_cla', |
|
|
|
method: 'POST', |
|
|
|
dataType: 'json', |
|
|
|
success: function() { |
|
|
|
showSuccessNotify(); |
|
|
|
$openClaAction.show(); |
|
|
|
$closeClaAction.hide(); |
|
|
|
}, |
|
|
|
error: function(res){ |
|
|
|
$.notify({ message: res.responseJSON.message }, { type: 'danger' }); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|