diff --git a/web/kanban-order.js b/web/kanban-order.js index 4c29e7e..5107588 100644 --- a/web/kanban-order.js +++ b/web/kanban-order.js @@ -494,6 +494,7 @@ const FINAL_TITLE={correction:'Correção do cliente',generated:'Gerado pelo sis // What the system generated for an item: one PNG, or the parts of a film // over 15 m (item 13). An item generated before parts has just its file. const generatedFiles=row=>row.parts?.length?row.parts:[{upload_id:row.upload_id,name:row.name}]; +const partsLabel=files=>files.length>1?files.length+' partes, '+files[0].name+' a '+files[files.length-1].name:files[0].name; // Per item, the files that can be approved as they are, or null: the // customer's correction, or else what the system generated (or the original // that already was one). After a correction, a generated file reproduces @@ -506,7 +507,7 @@ function readyFinals(order){ const made=fixes.length?null:(order.print_files||[]).find(r=>r.item_index===index&&r.status==='ready'); if(!made)return null; const original=made.detail?.source==='original', files=generatedFiles(made); - const names=files.length>1?files.length+' partes, '+files[0].name+' a '+files[files.length-1].name:files[0].name; + const names=partsLabel(files); return {files,name:files[0].name,source:original?'original':'generated',label:(original?'O original (':'Gerado pelo sistema (')+names+')'}; }); } @@ -1089,7 +1090,8 @@ function itemCard(order,item,index){ }else{ const original=row.status==='ready'&&row.detail?.source==='original'; notes.append(itemNote((original?'O original é o arquivo de impressão':PRINT_TEXT[row.status])+ - (row.status==='ready'&&row.name&&!original?': '+row.name:'')+(row.status==='ready'&&row.detail?.vector_sources&&!original?', PDF vetorial':''),row.status==='ready'?'ok':'')); + // A film in parts is all its parts, not the first one's name (#130). + (row.status==='ready'&&row.name&&!original?': '+partsLabel(generatedFiles(row)):'')+(row.status==='ready'&&row.detail?.vector_sources&&!original?', PDF vetorial':''),row.status==='ready'?'ok':'')); } if(['rec','tra','cor'].includes(order.state)){ const done=(order.final_items||[]).includes(index);