Files
simple-aircraft-manager-rails/app/views/oil_analyses/_import.html.erb
T
rickyandClaude Opus 5.5 d519aa9aae Track oil analysis reports; import AvLab PDFs
New Oil Analysis tab: one record per oil sample with dates, hours, the lab's
verdict and comments, ppm results for 12 wear metals with the lab's averages,
and the report PDF. Shows wear-metal trends, a side-by-side history table,
and flags readings 1.5x or more above the lab average.

AvLab report PDFs can be imported: every sample on the report (current and
previous) is added unless already recorded, the engine is matched by serial
number, and reports for another tail number are refused. The parser reads
positioned text and drops the hidden color-code layer that overlaps results.

Adds the pdf-reader gem. Test fixture is a rebuilt report with a dummy header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 06:12:51 -05:00

7 lines
578 B
ERB

<%# Upload a lab report PDF to create the sample records. Locals: aircraft %>
<%= form_with url: import_aircraft_oil_analyses_path(aircraft), multipart: true, class: "flex flex-wrap items-center gap-2" do |f| %>
<%= f.file_field :report, accept: ".pdf,application/pdf", required: true, "aria-label": "Lab report PDF",
class: "block text-sm text-slate-600 file:mr-3 file:rounded-md file:border-0 file:bg-slate-100 file:px-3 file:py-1.5 file:text-sm file:font-medium hover:file:bg-slate-200" %>
<%= f.submit "Import report", class: "btn-secondary btn-sm" %>
<% end %>