diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-06-20 22:27:47 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-06-20 22:27:47 (GMT) |
commit | cd15540f94bdb78556a5bd8e47df1f2919b97ac7 (patch) | |
tree | fb04caafed64b8b1faffd52bfd9c88e0300138d5 /www/js | |
parent | ed373caa60162aee97241dbc91e579a3964812f6 (diff) |
import errors are printed inside cart row now
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/shows.js | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/www/js/shows.js b/www/js/shows.js index 077cf42..a08ac94 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -30,8 +30,9 @@ function shows_importCartCancel(cart, dz) { } function shows_importFileUploadError(cart, dz, file, msg, xhr) { - alertbox.error('app-shows', "Import Fehler", $('<div>').append($('<pre>').text(msg)).html()); - shows_deleteCart(cart); + var error_row = shows_newImportErrorEntry(cart, msg); + error_row.find('button').unbind('click').click(function() { shows_deleteCart(cart); }); + $('#show-cart-' + cart).replaceWith(error_row); dz.disable(); } @@ -145,7 +146,8 @@ function shows_newCartEntry(elem) { .append($('<td>').text(cart.imported)) .append($('<td>').text(cart.playcnt)) .append($('<td>').text(cart.lastplayed)) - .append($('<td>').append(buttons)).attr("id", "show-cart-" + elem); + .append($('<td>').append(buttons)) + .attr("id", "show-cart-" + elem); } function shows_newImportingEntry(cart) { @@ -161,6 +163,24 @@ function shows_newImportingEntry(cart) { .attr("id", "show-cart-" + cart); } +function shows_newImportErrorEntry(cart, msg) { + var dismiss_button = '<button class="btn btn-danger btn-mini">' + + '<i class="icon-remove icon-white"></i> Ok</button>'; + + var xmlDoc = $.parseXML(msg); + msg = $(xmlDoc); + var resp_code = msg.find('ResponseCode').text(); + var err_string = msg.find('ErrorString').text(); + var reason = $('<span>').addClass('badge').addClass('badge-error').text(resp_code).after($('<b>').html(' ' + err_string)) + + return $('<tr>').append($('<td>').text(cart)) + .append($('<td>').addClass('file-name').text('-')) + .append($('<td>').append($('<b>').text('Import Fehler'))) + .append($('<td colspan=3>').append(reason)) + .append($('<td>').append(dismiss_button)) + .attr("id", "show-cart-" + cart); +} + function shows_updateGroupCartInfo(cart) { data = { COMMAND: 7, LOGIN_NAME: auth_username, PASSWORD: auth_token, CART_NUMBER: cart, INCLUDE_CUTS: 1 }; var defer = $.post("/rd-bin/rdxport.cgi", data, shows_updateGroupCartList, "xml") |