flash('error', $::locale->text('There was an error parsing the csv file: #1 in line #2.', $first_error->[2], $first_error->[0]));
}
- if (!$data->{progress}{finished}) {
- $self->render('csv_import/_deferred_results', { no_layout => 1 });
- } else {
+ if ($data->{progress}{finished} || $data->{errors}) {
$self->action_report(report_id => $data->{report_id}, no_layout => 1);
+ } else {
+ $self->render('csv_import/_deferred_results', { no_layout => 1 });
}
}
<h2>[% 'Import Status' | $T8 %]</h2>
[% PROCESS 'common/flash.html' %]
+[% UNLESS SELF.background_job.data_as_hash.errors %]
<div id='progress_description'></div>
<div id='progressbar'></div>
+[% END %]
<script type='text/javascript'>
function reload_results () {
$.ajax({
error: function(e) { alert(e) },
});
}
-[%- UNLESS SELF.background_job.data_as_hash.progress < 0 %]
+[%- UNLESS SELF.background_job.data_as_hash.errors %]
$(document).ready(function(){
$('#progress_description').html('[% SELF.background_job.data_as_hash.progress.plan.${SELF.background_job.data_as_hash.progress.phase} %] / [% SELF.background_job.data_as_hash.progress.num_phases %] [% SELF.background_job.data_as_hash.progress.phase | $T8 | html %]');
$('#progressbar').progressbar({ value: [% SELF.background_job.data_as_hash.progress.progress * 1 %] });