mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 05:34:04 +00:00
Using flash instead of alerts in the schedule
Using flash instead of alerts in the schedule to notify errors. Also, a message shown when a schedule is successfully created.
This commit is contained in:
parent
81108290e5
commit
5761e0f7a4
7 changed files with 19 additions and 11 deletions
|
|
@ -37,12 +37,12 @@
|
|||
//= require osem-datatables
|
||||
//= require osem-tickets
|
||||
//= require bootstrap-switch
|
||||
//= require osem-schedule
|
||||
//= require osem-switch
|
||||
//= require osem-bootstrap
|
||||
//= require osem-commercials
|
||||
//= require unobtrusive_flash
|
||||
//= require unobtrusive_flash_bootstrap
|
||||
//= require osem-schedule
|
||||
|
||||
$(document).ready(function() {
|
||||
$('a[disabled=disabled]').click(function(event){
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
var url; // Should be initialize in Schedule.initialize
|
||||
var schedule_id; // Should be initialize in Schedule.initialize
|
||||
|
||||
var error_remove = "The event couldn't be unscheduled";
|
||||
function showError(error){
|
||||
// Delete other error messages before showing the new one
|
||||
$('.unobtrusive-flash-container').empty();
|
||||
UnobtrusiveFlash.showFlashMessage(error, {type: 'error'});
|
||||
}
|
||||
|
||||
var Schedule = {
|
||||
initialize: function(url_param, schedule_id_param) {
|
||||
url = url_param;
|
||||
|
|
@ -20,7 +25,7 @@ var Schedule = {
|
|||
e.find(".schedule-event-delete-button").hide();
|
||||
}
|
||||
else{
|
||||
alert(error_remove);
|
||||
showError(data.status);
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
|
|
@ -31,7 +36,7 @@ var Schedule = {
|
|||
});
|
||||
}
|
||||
else{
|
||||
alert(error_remove);
|
||||
showError("The event couldn't be unscheduled");
|
||||
}
|
||||
},
|
||||
add: function (previous_parent, new_parent, event) {
|
||||
|
|
@ -57,7 +62,7 @@ var Schedule = {
|
|||
}
|
||||
else{
|
||||
event.appendTo(previous_parent);
|
||||
alert("The event couldn't been scheduled");
|
||||
showError("The event couldn't been scheduled");
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ $(function () {
|
|||
|
||||
var callback = function(data) {
|
||||
if(data.status != 'ok'){
|
||||
alert("The schedule couldn't been updated");
|
||||
showError(data.status);
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue