mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Attach a CGR-30 flight recording when logging a flight or later from the flight page. The flight page shows engine run time, fuel burned, tach and engine hours, peak RPM/EGT/CHT/oil/fuel flow, and charts per cylinder. Unreadable files are rejected; recordings from another tail are flagged. Also replace the real tail number in test data with N12345. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
2.5 KiB
ERB
34 lines
2.5 KiB
ERB
<% content_for :title, "#{@aircraft.tail_number} Flights" %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<% if @stats.any? %><%= render "flight_logs/stats", stats: @stats %><% end %>
|
|
<section class="card">
|
|
<div class="card-header"><h2 class="card-title">Flight Log</h2><div class="flex gap-2"><%= link_to "Export for AirTrail", new_aircraft_air_trail_export_path(@aircraft), class: "btn-secondary" %><% if owner? %><%= link_to "Standardize airport codes", aircraft_airport_codes_path(@aircraft), class: "btn-secondary" %><%= link_to "Import from spreadsheet", new_aircraft_flight_import_path(@aircraft), class: "btn-secondary" %><% end %><%= link_to "+ Log Flight", new_aircraft_flight_log_path(@aircraft), class: "btn-primary" %></div></div>
|
|
<% if @flight_logs.any? %>
|
|
<div class="overflow-x-auto">
|
|
<table class="table">
|
|
<thead><tr><th>Date</th><th>Route</th><th class="text-right">Tach</th><th class="text-right">Hobbs</th><th class="text-right">Oil (qt)</th><th class="text-right">Fuel (gal)</th><th class="pl-6">Pilot</th></tr></thead>
|
|
<tbody>
|
|
<% blank = tag.span("—", class: "text-slate-300") %>
|
|
<% @flight_logs.each do |fl| %>
|
|
<tr>
|
|
<td class="whitespace-nowrap"><%= link_to fl.date, aircraft_flight_log_path(@aircraft, fl), class: "link" %></td>
|
|
<td class="whitespace-nowrap">
|
|
<%= fl.route_summary.presence || blank %>
|
|
<% if fl.track_log.attached? %><span class="ml-1" title="GPS track attached" aria-label="GPS track attached">📍</span><% end %>
|
|
<% if fl.engine_data.attached? %><span class="ml-1" title="Engine data attached" aria-label="Engine data attached">📈</span><% end %>
|
|
</td>
|
|
<td class="text-right tabular-nums"><%= fl.tach_time ? hours(fl.tach_time) : blank %></td>
|
|
<td class="text-right tabular-nums"><%= fl.hobbs_time ? hours(fl.hobbs_time) : blank %></td>
|
|
<td class="text-right tabular-nums"><%= fl.oil_added ? number_with_precision(fl.oil_added, precision: 2, strip_insignificant_zeros: true) : blank %></td>
|
|
<td class="text-right tabular-nums"><%= fl.fuel_added ? number_with_precision(fl.fuel_added, precision: 2, strip_insignificant_zeros: true) : blank %></td>
|
|
<td class="pl-6 text-slate-600"><%= fl.user&.display_name || blank %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<% else %>
|
|
<%= empty_state "No flights logged yet." %>
|
|
<% end %>
|
|
</section>
|