% content_for :title, "#{@aircraft.tail_number} Loading setup" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<% stations = @setup.stations + Array.new([ 8 - @setup.stations.size, 2 ].max) { nil } %>
<% points = @setup.envelope + Array.new([ 10 - @setup.envelope.size, 2 ].max) { nil } %>
<%= form_with url: aircraft_loading_setup_path(@aircraft), method: :patch, class: "card card-body max-w-3xl space-y-5" do %>
Loading setup
From the POH's weight and balance section. Arms are inches aft of the datum.
<% if @setup.errors.any? %>
<% @setup.errors.full_messages.each do |m| %>- <%= m %>
<% end %>
<% end %>
<%= label_tag "setup[fuel_lb_per_gal]", "Fuel weight (lb per gallon)", class: "label" %>
<%= text_field_tag "setup[fuel_lb_per_gal]", @setup.fuel_lb_per_gal.to_s.sub(/\.0\z/, ""), class: "input", inputmode: "decimal" %>
6 for avgas, 6.7 for Jet-A.
<%= submit_tag "Save", class: "btn-primary" %><%= link_to "Cancel", aircraft_weight_balance_records_path(@aircraft), class: "btn-secondary" %>
<% end %>