% content_for :title, "Log Flight" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= form_with model: [@aircraft, @flight_log], class: "card card-body space-y-5 max-w-3xl" do |f| %>
<%= f.errors_summary %>
<%= f.field :date, as: :date, required: true %>
<%= f.field :departure_location, label: "From", placeholder: "KPVD" %>
<%= f.field :destination_location, label: "To", placeholder: "KBID" %>
<%= f.field :route, as: :textarea, rows: 2 %>
<%= f.field :notes, as: :textarea, rows: 2 %>
<%= f.field :track_log, as: :file, label: "Track log (GPX/KML/CSV)" %>
Saving adds the tach time to the aircraft and all in-service components, and records any oil/fuel added.
<%= f.submit "Log Flight" %><%= link_to "Cancel", aircraft_flight_logs_path(@aircraft), class: "btn-secondary" %>
<% end %>