4 [% SET report = job.report %]
6 <div class="dialog message">
7 [% IF job.status == 'finished' %]
8 <table id="finishedtable">
11 <td>[% report.file_name | html %]</td>
14 <td>Total lines processed</td>
15 <td>[% report.total_lines | html %]</td>
18 <td>Titles imported</td>
19 <td>[% report.titles_imported | html %]</td>
22 <td>Duplicates found</td>
23 <td>[% report.duplicates_found | html %]</td>
26 <td>Failed imports</td>
27 <td>[% report.failed_imports | html %]</td>
30 [% ELSIF job.status == 'started' %]
31 <p id="jobactionlabel"></p>
33 [% IF job.status != 'finished' %]
34 [% INCLUDE "job_progress.inc" job_id=job.id %]
36 [% IF job.status == 'cancelled' %]
37 <p>The job has been cancelled before it finished.</p>
43 [% Asset.js("js/job_progress.js") | $raw %]
46 [% FOR m IN job.messages %]
47 <div class="dialog message">
48 [% IF m.type == 'success' %]
49 <i class="fa fa-check success"></i>
50 [% ELSIF m.type == 'warning' %]
51 <i class="fa fa-warning warn"></i>
52 [% ELSIF m.type == 'error' %]
53 <i class="fa fa-exclamation error"></i>
56 [% CASE 'title_already_exists' %]
57 <span><strong>[% m.title | html %]</strong> already exists and was not created.</span>
58 [% CASE 'title_failed' %]
59 <span><strong>[% m.title | html %]</strong> failed to import - [% m.error_message | html %][% IF m.title_id %][% m.title_id | html %][% END %]</span>
60 [% CASE 'job_failed' %]
61 <span>Job failed - [% m.error_message | html %]</span>
66 [% Asset.js("js/job_progress.js") | $raw %]
69 [% INCLUDE 'str/job_progress.inc' job_id=job.id %]
70 [% INCLUDE 'str/import_from_kbart_file.inc' %]
72 $(document).ready(function(){
73 let job_id = [% job.id | html %];
74 updateProgress(job_id, {
75 progress_callback : function(){
76 $.getJSON('/api/v1/jobs/'+job_id, function(job){
77 if(job.progress == 0){
78 $('#jobactionlabel').text(READING_FILE);
79 }else if(job.progress >= 1){
80 $('#jobactionlabel').text(PROCESSING_FILE);
84 finish_callback : function(){
85 $.getJSON('/api/v1/jobs/'+job_id, function(job){
86 if(!$('#finishedtable').length){
87 window.location.reload();