mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
- Oil analysis: Blackstone PDF import (20 elements, oil properties, universal averages), results stored per element, oil type, "leave out of trends", the original app's statuses; AvLab fixes (multi-line comments, unrelated labels no longer steal values). Existing records migrate. - Aircraft archives in the original app's .sam.zip format (schema v2): export from Access & Sharing, background import from the Fleet page, rake tasks. Archives move both ways between this app and the original. - Scanned logbook pages (images or PDFs) upload as a document; with ANTHROPIC_API_KEY set, Claude transcribes them into logbook entries. - Fix: deleting a component or aircraft failed when AD compliances or inspection records pointed at a component. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
2.1 KiB
ERB
37 lines
2.1 KiB
ERB
<% content_for :title, "#{@aircraft.tail_number} Logbook" %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<section class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title">Maintenance Logbook</h2>
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
<%= form_with url: aircraft_logbook_entries_path(@aircraft), method: :get, class: "flex gap-2" do |f| %>
|
|
<%= f.search_field :q, value: @query, placeholder: "Search entries…", class: "input w-48" %>
|
|
<%= f.select :log_type, LogbookEntry::LOG_TYPES.invert, { include_blank: "All logs", selected: @log_type }, class: "input w-32" %>
|
|
<%= f.submit "Filter", class: "btn-secondary" %>
|
|
<% end %>
|
|
<% if owner? %><%= link_to "Import scans", new_aircraft_logbook_import_path(@aircraft), class: "btn-secondary" %><%= link_to "+ New Entry", new_aircraft_logbook_entry_path(@aircraft), class: "btn-primary" %><% end %>
|
|
</div>
|
|
</div>
|
|
<% if @entries.any? %>
|
|
<div class="overflow-x-auto">
|
|
<table class="table">
|
|
<thead><tr><th>Date</th><th>Log</th><th>Type</th><th class="text-right">Hours</th><th>Entry</th><th>Signed off</th></tr></thead>
|
|
<tbody>
|
|
<% @entries.each do |e| %>
|
|
<tr>
|
|
<td class="whitespace-nowrap"><%= link_to e.date, aircraft_logbook_entry_path(@aircraft, e), class: "link" %></td>
|
|
<td><span class="badge-gray"><%= LogbookEntry::LOG_TYPES[e.log_type] %></span></td>
|
|
<td class="text-xs"><%= LogbookEntry::ENTRY_TYPES[e.entry_type] %></td>
|
|
<td class="text-right tabular-nums"><%= hours(e.aircraft_hours_at_entry) %></td>
|
|
<td class="max-w-xl"><%= e.text.truncate(220) %> <%= "📄" if e.document %></td>
|
|
<td class="text-xs text-slate-500"><%= e.signoff_person %><% if e.signoff_location.present? %><br><%= e.signoff_location %><% end %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<% else %>
|
|
<%= empty_state(@query.present? ? "No entries match “#{@query}”." : "No logbook entries yet.") %>
|
|
<% end %>
|
|
</section>
|