<% 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? %>
<% @flight_logs.each do |fl| %> <% end %>
DateRouteTachHobbsOilFuelPilot
<%= link_to fl.date, aircraft_flight_log_path(@aircraft, fl), class: "link" %> <%= fl.route_summary.presence || "—" %> <%= hours(fl.tach_time) %> <%= hours(fl.hobbs_time) %> <%= fl.oil_added ? "#{fl.oil_added} qt" : "" %> <%= fl.fuel_added ? "#{fl.fuel_added} gal" : "" %> <%= fl.user&.display_name %> <%= "📍" if fl.track_log.attached? %>
<% else %> <%= empty_state "No flights logged yet." %> <% end %>