diff --git a/Web/Scripts/Shared/ImportCreate.js b/Web/Scripts/Shared/ImportCreate.js index efb7502..536231f 100644 --- a/Web/Scripts/Shared/ImportCreate.js +++ b/Web/Scripts/Shared/ImportCreate.js @@ -1,12 +1,17 @@ function importLogs(userFullName) { $('.import-status').html('Pending tbody > tr:not(.complete)").length; $('#page-import-status').html(' Import In Progress Keep page open until complete.'); - + $('#page-import-status').after('
'); + submitNext(); var errorCount = 0; function submitNext() { var $logs = $("#logs > tbody > tr:not(.complete)"); + var percentComplete = Math.round( (1 - ($logs.length / total)) * 100 ); + $('.progress .bar').attr('style', 'width:' + percentComplete + '%'); + if ($logs.length > 0) { var $row = $($logs[0]); var data = $('form', $row).serialize(); @@ -28,6 +33,7 @@ $('.import-message', $row).text(result.Message); $('.import-status', $row).append(" " + result.Action); errorCount++; + $('.progress .bar').addClass('bar-warning'); } else if (result.Status == "Duplicate") { $('.import-status', $row).html('DuplicateComplete without errors.'); + $('.progress .bar').addClass('bar-success'); } else { $('#page-import-status').html('Complete but with errors. See details below.'); }