mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 18:52:23 +01:00
Improving alert box
Fixed error with the cancel button and upgraded the returned messages
This commit is contained in:
@ -49,13 +49,16 @@ $(function () {
|
||||
var songId = $(this).data('report-song-id');
|
||||
var message = prompt("What is wrong with the song?");
|
||||
if (message == "") {
|
||||
alert("Please enter a message.");
|
||||
createAlert('danger', 'Please enter a message.');
|
||||
return false
|
||||
}
|
||||
if (message == null) {
|
||||
return false
|
||||
}
|
||||
$.post('/api/report', {id: songId, msg: message, csrfmiddlewaretoken: csrf_token}, function (result) {
|
||||
console.log(result);
|
||||
if (result.success) {
|
||||
alert("Thanks for the report!");
|
||||
createAlert('success', 'Thanks for your song report!');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user