Lines 53-59
Link Here
|
53 |
|
53 |
|
54 |
<h1>Quote uploader</h1> |
54 |
<h1>Quote uploader</h1> |
55 |
|
55 |
|
56 |
<div id="messages" style="display: none;"> |
56 |
[%# FIXME Remove the following div and use #message instead %] |
|
|
57 |
<div id="messages_2" style="display: none;"> |
57 |
<div class="import_success dialog message" style="display: none;"></div> |
58 |
<div class="import_success dialog message" style="display: none;"></div> |
58 |
<div class="import_error dialog alert" style="display: none;"></div> |
59 |
<div class="import_error dialog alert" style="display: none;"></div> |
59 |
</div> |
60 |
</div> |
Lines 242-248
Link Here
|
242 |
if ( arrData[ arrData.length - 1 ] ) { |
243 |
if ( arrData[ arrData.length - 1 ] ) { |
243 |
arrData[ arrData.length - 1 ].push( strMatchedValue ); |
244 |
arrData[ arrData.length - 1 ].push( strMatchedValue ); |
244 |
} else { |
245 |
} else { |
245 |
$("#messages .import_error").text(_("Something went wrong, check your CSV file.")); |
246 |
$("#messages_2 .import_error").text(_("Something went wrong, check your CSV file.")); |
246 |
} |
247 |
} |
247 |
} |
248 |
} |
248 |
|
249 |
|
Lines 389-412
Link Here
|
389 |
data : JSON.stringify(data), |
390 |
data : JSON.stringify(data), |
390 |
dataType : "application/json", |
391 |
dataType : "application/json", |
391 |
success : function(data) { |
392 |
success : function(data) { |
392 |
$("#messages").addClass("message").show(); |
393 |
$("#messages_2").addClass("message").show(); |
393 |
var import_success = $("#messages .import_success"); |
394 |
var import_success = $("#messages_2 .import_success"); |
394 |
import_success.show(); |
395 |
import_success.show(); |
395 |
import_success.data("nb") |
396 |
import_success.data("nb") |
396 |
nb_success = import_success.data("nb") || 0; |
397 |
nb_success = import_success.data("nb") || 0; |
397 |
nb_success++; |
398 |
nb_success++; |
398 |
$("#messages .import_success").text(MSG_IMPORT_SUCCESS.format(nb_success)); |
399 |
$("#messages_2 .import_success").text(MSG_IMPORT_SUCCESS.format(nb_success)); |
399 |
import_success.data("nb", nb_success); |
400 |
import_success.data("nb", nb_success); |
400 |
}, |
401 |
}, |
401 |
error : function(xhr) { |
402 |
error : function(xhr) { |
402 |
if (xhr.status==201) { this.success(null, "Created", xhr); return; } |
403 |
if (xhr.status==201) { this.success(null, "Created", xhr); return; } |
403 |
$("#messages").addClass("alert").show(); |
404 |
$("#messages_2").addClass("alert").show(); |
404 |
var import_error = $("#messages .import_error"); |
405 |
var import_error = $("#messages_2 .import_error"); |
405 |
import_error.show(); |
406 |
import_error.show(); |
406 |
import_error.data("nb") |
407 |
import_error.data("nb") |
407 |
nb_error = import_error.data("nb") || 0; |
408 |
nb_error = import_error.data("nb") || 0; |
408 |
nb_error++; |
409 |
nb_error++; |
409 |
$("#messages .import_error").text(MSG_IMPORT_ERROR.format(nb_error)); |
410 |
$("#messages_2 .import_error").text(MSG_IMPORT_ERROR.format(nb_error)); |
410 |
import_error.data("nb", nb_error); |
411 |
import_error.data("nb", nb_error); |
411 |
}, |
412 |
}, |
412 |
}); |
413 |
}); |