summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-06-20 22:27:47 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-06-20 22:27:47 (GMT)
commitcd15540f94bdb78556a5bd8e47df1f2919b97ac7 (patch)
treefb04caafed64b8b1faffd52bfd9c88e0300138d5 /www
parented373caa60162aee97241dbc91e579a3964812f6 (diff)
import errors are printed inside cart row now
Diffstat (limited to 'www')
-rw-r--r--www/js/shows.js26
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('&nbsp;' + 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")