<#macro batchStatusBadge status> <#if status == 'COMPLETED'><@tag color='success'>#i18n{module.appointment.importer.status.COMPLETED} <#elseif status == 'COMPLETED_WITH_ERRORS'><@tag color='danger'>#i18n{module.appointment.importer.status.COMPLETED_WITH_ERRORS} <#elseif status == 'PROCESSING'><@tag color='warning'>#i18n{module.appointment.importer.status.PROCESSING} <#elseif status == 'VALIDATION_FAILED'><@tag color='danger'>#i18n{module.appointment.importer.status.VALIDATION_FAILED} <#elseif status == 'PENDING'><@tag color='secondary'>#i18n{module.appointment.importer.status.PENDING} <#else><@tag color='secondary'>${status?html} <#macro rowStatusBadge status> <#if status == 'CREATED'><@tag color='success'>#i18n{module.appointment.importer.status.CREATED} <#elseif status == 'ERROR'><@tag color='danger'>#i18n{module.appointment.importer.status.ERROR} <#elseif status == 'PROCESSING'><@tag color='warning'>#i18n{module.appointment.importer.status.PROCESSING} <#elseif status == 'REPLACED'><@tag color='info'>#i18n{module.appointment.importer.status.REPLACED} <#elseif status == 'PENDING'><@tag color='secondary'>#i18n{module.appointment.importer.status.PENDING} <#else><@tag color='secondary'>${status?html} <@messages errors=errors![] warnings=warnings![] infos=infos![] /> <@row><@columns lg=10 offsetLg=1> <@box class='border shadow-sm'>

#i18n{module.appointment.importer.sectionBatches} — #${import_batch.idImportBatch}

<@aButton href=back_to_results_url buttonIcon='arrow-left' title='#i18n{module.appointment.importer.buttonBack}' size='sm' color='light' />
<@boxBody>
#i18n{module.appointment.importer.labelBatchFile}
${import_batch.importFileName?html}
#i18n{module.appointment.importer.labelBatchForm}
<#if import_batch.formTitle?has_content>${import_batch.formTitle?html}<#else>${import_batch.idForm}
#i18n{module.appointment.importer.labelBatchSlot}
${import_batch.startingDateTimeLabel?html} – ${import_batch.endingTimeLabel?html}
#i18n{module.appointment.importer.labelBatchStatus}
<@batchStatusBadge status=import_batch.status />
#i18n{module.appointment.importer.labelBatchProcessed}
${processed_rows_count} / ${total_rows_count}
#i18n{module.appointment.importer.columnRows}
${import_batch.counts.created} #i18n{module.appointment.importer.countCreated} · ${import_batch.counts.errors} #i18n{module.appointment.importer.countErrors} <#if import_batch.counts.replaced gt 0>· ${import_batch.counts.replaced} #i18n{module.appointment.importer.countReplaced}
<@aButton href=batch_url title='#i18n{module.appointment.importer.buttonAllRows}' size='sm' color='light' /> <@aButton href='${batch_url}&status=ERROR' title='#i18n{module.appointment.importer.buttonErrors}' color='danger' size='sm' /> <@aButton href='${batch_url}&status=CREATED' title='#i18n{module.appointment.importer.buttonCreated}' color='success' size='sm' /> <#if can_retry && import_batch.status == 'COMPLETED_WITH_ERRORS'> <@tform class='d-inline ms-auto' action='jsp/admin/plugins/appointment/modules/importer/ManageAppointmentImport.jsp'> <@input type='hidden' name='id_import_batch' value='${import_batch.idImportBatch}' /> <@button type='submit' name='action_doRetryImportBatch' title='#i18n{module.appointment.importer.buttonRetryErrors}' color='warning' size='sm' buttonIcon='refresh' />
<@table class='table-sm table-striped table-hover table-vcenter'> #i18n{module.appointment.importer.columnLine} #i18n{module.appointment.importer.filterStatus} #i18n{module.appointment.importer.columnError} #i18n{module.appointment.importer.columnAppointment} <#list import_rows as row> ${row.sourceLineNumber} <@rowStatusBadge status=row.status /> ${row.errorMessage!?html} <#if row.idAppointment??> <@aButton href='jsp/admin/plugins/appointment/ManageAppointments.jsp?view=viewAppointment&id_form=${import_batch.idForm}&id_appointment=${row.idAppointment}' title='#i18n{module.appointment.importer.buttonViewAppointment}' size='sm' buttonIcon='eye' /> <#elseif can_retry && row.status == 'ERROR' && import_batch.status != 'PROCESSING' && import_batch.status != 'ARCHIVED'> <@aButton href='jsp/admin/plugins/appointment/modules/importer/ManageAppointmentImport.jsp?view=modifyImportRow&id_import_appointment=${row.idImportAppointment}' title='#i18n{module.appointment.importer.buttonCorrectRow}' size='sm' buttonIcon='pencil' color='light' /> <#-- The retry asks for a confirmation, which warns when the row was interrupted: its appointment may exist --> <#if (row.errorCode!) == interrupted_code> <@aButton href='jsp/admin/plugins/appointment/modules/importer/ManageAppointmentImport.jsp?view=confirmRetryImportRow&id_import_appointment=${row.idImportAppointment}' title='#i18n{module.appointment.importer.buttonRetryInterruptedRow}' color='danger' size='sm' buttonIcon='refresh' /> <#else> <@aButton href='jsp/admin/plugins/appointment/modules/importer/ManageAppointmentImport.jsp?view=confirmRetryImportRow&id_import_appointment=${row.idImportAppointment}' title='#i18n{module.appointment.importer.buttonRetryRow}' color='warning' size='sm' buttonIcon='refresh' />