|
|
@@ -140,11 +140,6 @@ $(document).ready( function () {
|
|
|
data: '{notif_id:' + notif_id + '}',
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
dataType: "json",
|
|
|
- beforeSend: function(xhr, settings) {
|
|
|
- if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
|
|
|
- xhr.setRequestHeader("X-CSRFToken", csrftoken);
|
|
|
- }
|
|
|
- },
|
|
|
success: function (response) {
|
|
|
notif.remove();
|
|
|
},
|
|
|
@@ -166,11 +161,6 @@ $(document).ready( function () {
|
|
|
url: "/notif/allseen/",
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
dataType: "json",
|
|
|
- beforeSend: function(xhr, settings) {
|
|
|
- if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
|
|
|
- xhr.setRequestHeader("X-CSRFToken", csrftoken);
|
|
|
- }
|
|
|
- },
|
|
|
success: function (response) {
|
|
|
notif_list.html('');
|
|
|
$('.notif-footer').html('<i>Aucune notification à afficher</i>');
|
|
|
@@ -187,4 +177,89 @@ $(document).ready( function () {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ $("#backlog-editor").on('submit', 'form', function(event) {
|
|
|
+ event.preventDefault();
|
|
|
+
|
|
|
+ var action = $(this).attr('action');
|
|
|
+ var val_field = $(this).find('input[name=value]');
|
|
|
+
|
|
|
+ console.log(action);
|
|
|
+ console.log(val_field.val())
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: action,
|
|
|
+ data : { value : val_field.val() },
|
|
|
+ success: function (response) {
|
|
|
+ val_field.animate({ borderColor: "#009933" }, 1500, function() {
|
|
|
+ val_field.removeAttr('style'); } );
|
|
|
+ },
|
|
|
+ failure: function (response) {
|
|
|
+ val_field.animate({ borderColor: "#ff0000" }, 1500, function() {
|
|
|
+ val_field.removeAttr('style'); } );
|
|
|
+ console.log('Ajax failure: ' + response.responseText);
|
|
|
+ $("#backlog-editor").unbind('submit'); // Ajax is not working: unbind
|
|
|
+ $(this).submit();
|
|
|
+ },
|
|
|
+
|
|
|
+ error: function (response) {
|
|
|
+ val_field.animate({ borderColor: "#ff0000" }, 1500, function() {
|
|
|
+ val_field.removeAttr('style'); } );
|
|
|
+ console.log('Ajax error: ' + response.responseText);
|
|
|
+ $("#backlog-editor").unbind('submit'); // Ajax is not working: unbind
|
|
|
+ $(this).submit();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#backlog-editor").on('click', '.btn-epic-close', function(event) {
|
|
|
+ event.preventDefault();
|
|
|
+
|
|
|
+ var action = $(this).attr('href');
|
|
|
+ this_btn = $(this);
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: action,
|
|
|
+ success: function (response) {
|
|
|
+ this_btn.addClass('disabled');
|
|
|
+ this_btn.closest('tr').find(".epic-name").addClass('story-closed');
|
|
|
+ },
|
|
|
+ failure: function (response) {
|
|
|
+ alert(response.responseText);
|
|
|
+ },
|
|
|
+ error: function (response) {
|
|
|
+ alert(response.responseText);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#backlog-editor").on('click', '.btn-epic-reopen', function(event) {
|
|
|
+ event.preventDefault();
|
|
|
+
|
|
|
+ var action = $(this).attr('href');
|
|
|
+ this_btn = $(this);
|
|
|
+ name_field = this_btn.closest('tr').find(".epic-name");
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: action,
|
|
|
+ success: function (response) {
|
|
|
+ this_btn.addClass('disabled');
|
|
|
+ name_field.removeClass('story-closed');
|
|
|
+ name_field.html(name_field.html().replace('[Fermée] ', ''));
|
|
|
+ },
|
|
|
+ failure: function (response) {
|
|
|
+ alert(response.responseText);
|
|
|
+ },
|
|
|
+ error: function (response) {
|
|
|
+ alert(response.responseText);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
});
|