mirror of
https://github.com/cydrobolt/polr.git
synced 2024-09-19 23:21:47 +02:00
Merge pull request #384 from tdtgit/delete-link-confirm
Users should be warned before they delete users or links
This commit is contained in:
commit
d39efe6aef
@ -264,6 +264,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
|
|||||||
|
|
||||||
// Delete user
|
// Delete user
|
||||||
$scope.deleteUser = function($event, user_id) {
|
$scope.deleteUser = function($event, user_id) {
|
||||||
|
if(confirm("Are you sure to delete this user?")){
|
||||||
var el = $($event.target);
|
var el = $($event.target);
|
||||||
|
|
||||||
apiCall('admin/delete_user', {
|
apiCall('admin/delete_user', {
|
||||||
@ -272,6 +273,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
|
|||||||
toastr.success('User successfully deleted.', 'Success');
|
toastr.success('User successfully deleted.', 'Success');
|
||||||
$scope.reloadUserTables();
|
$scope.reloadUserTables();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.changeUserRole = function(role, user_id) {
|
$scope.changeUserRole = function(role, user_id) {
|
||||||
@ -305,6 +307,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
|
|||||||
|
|
||||||
// Delete link
|
// Delete link
|
||||||
$scope.deleteLink = function($event, link_ending) {
|
$scope.deleteLink = function($event, link_ending) {
|
||||||
|
if(confirm("Are you sure to delete this link?")){
|
||||||
var el = $($event.target);
|
var el = $($event.target);
|
||||||
|
|
||||||
apiCall('admin/delete_link', {
|
apiCall('admin/delete_link', {
|
||||||
@ -313,6 +316,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
|
|||||||
toastr.success('Link successfully deleted.', 'Success');
|
toastr.success('Link successfully deleted.', 'Success');
|
||||||
$scope.reloadLinkTables();
|
$scope.reloadLinkTables();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Disable and enable links
|
// Disable and enable links
|
||||||
|
Loading…
Reference in New Issue
Block a user