|
|
@ -16,32 +16,4 @@
|
|
|
|
$('textarea').attr('rows', 5);
|
|
|
|
$('textarea').attr('rows', 5);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sweet Alert for Delete
|
|
|
|
|
|
|
|
// Todo: Change name to objectDelete(obj, name, url)
|
|
|
|
|
|
|
|
function objectDelete(obj, name, url){
|
|
|
|
|
|
|
|
swal({
|
|
|
|
|
|
|
|
title: "{% trans 'Are you sure delete ?' %}",
|
|
|
|
|
|
|
|
text: "【" + name + "】",
|
|
|
|
|
|
|
|
type: "warning",
|
|
|
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
|
|
|
cancelButtonText: "{% trans 'Cancel' %}",
|
|
|
|
|
|
|
|
confirmButtonColor: "#DD6B55",
|
|
|
|
|
|
|
|
confirmButtonText: "{% trans 'Yes, delete it!' %}",
|
|
|
|
|
|
|
|
closeOnConfirm: false
|
|
|
|
|
|
|
|
}, function () {
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
type : "post",
|
|
|
|
|
|
|
|
url : url,
|
|
|
|
|
|
|
|
data : {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
dataType : "text",
|
|
|
|
|
|
|
|
success : function(data) {
|
|
|
|
|
|
|
|
swal("{% trans 'Deleted!' %}", "【"+name+"】"+"{% trans 'has been deleted.' %}", "success");
|
|
|
|
|
|
|
|
$(obj).parent().parent().remove();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|