<% content_for :title, "#{@aircraft.tail_number} Flights" %> <%= render "shared/aircraft_header", aircraft: @aircraft %> <% if @stats.any? %><%= render "flight_logs/stats", stats: @stats %><% end %>

Flight Log

<%= 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" %>
<% if @flight_logs.any? %>
<% blank = tag.span("—", class: "text-slate-300") %> <% @flight_logs.each do |fl| %> <% end %>
DateRouteTachHobbsOil (qt)Fuel (gal)Pilot
<%= link_to fl.date, aircraft_flight_log_path(@aircraft, fl), class: "link" %> <%= fl.route_summary.presence || blank %> <% if fl.track_log.attached? %>📍<% end %> <%= fl.tach_time ? hours(fl.tach_time) : blank %> <%= fl.hobbs_time ? hours(fl.hobbs_time) : blank %> <%= fl.oil_added ? number_with_precision(fl.oil_added, precision: 2, strip_insignificant_zeros: true) : blank %> <%= fl.fuel_added ? number_with_precision(fl.fuel_added, precision: 2, strip_insignificant_zeros: true) : blank %> <%= fl.user&.display_name || blank %>
<% else %> <%= empty_state "No flights logged yet." %> <% end %>