mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
- Entries transcribed by Claude are unverified (with Claude's confidence) until an owner checks them against the scan: badge, filter, "mark verified" stepping through the rest - Preventive maintenance templates on new logbook entries, keyed to Part 43 Appendix A(c), setting the entry type and pilot certificate (43.3(g)) - An STC's ICA can become a tracked recurring inspection, linked from its major record - Weight & balance: history of empty weight/CG (linked to the 337 that changed them), loading stations and CG envelope from the POH, and a live calculator for takeoff and landing weight/CG; shown on the status report - New ADs: weekly Federal Register search per aircraft (aircraft, engine and propeller models, or custom terms); track or dismiss each; included in the weekly reminder - Archives carry the new records; brakeman: explicit params, reviewed About-page links Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
3.4 KiB
ERB
44 lines
3.4 KiB
ERB
<% 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 %>
|
|
<div>
|
|
<h2 class="card-title">Loading setup</h2>
|
|
<p class="mt-1 text-sm text-slate-600">From the POH's weight and balance section. Arms are inches aft of the datum.</p>
|
|
</div>
|
|
<% if @setup.errors.any? %>
|
|
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200" role="alert"><ul class="list-disc pl-5"><% @setup.errors.full_messages.each do |m| %><li><%= m %></li><% end %></ul></div>
|
|
<% end %>
|
|
<fieldset>
|
|
<legend class="label">Stations</legend>
|
|
<div class="grid grid-cols-[1fr_6rem_6rem_auto] gap-2 text-xs text-slate-500"><span>Name</span><span>Arm (in)</span><span>Max</span><span>Fuel (gal)</span></div>
|
|
<% stations.each_with_index do |st, i| %>
|
|
<div class="mt-1 grid grid-cols-[1fr_6rem_6rem_auto] items-center gap-2">
|
|
<%= text_field_tag "setup[stations][#{i}][name]", st&.name, class: "input", placeholder: ("Front seats" if i.zero?), "aria-label": "Station #{i + 1} name" %>
|
|
<%= text_field_tag "setup[stations][#{i}][arm]", st&.arm&.to_s&.sub(/\.0\z/, ""), class: "input", inputmode: "decimal", "aria-label": "Station #{i + 1} arm" %>
|
|
<%= text_field_tag "setup[stations][#{i}][max]", st&.max&.to_s&.sub(/\.0\z/, ""), class: "input", inputmode: "decimal", "aria-label": "Station #{i + 1} maximum" %>
|
|
<%= check_box_tag "setup[stations][#{i}][fuel]", "1", st&.fuel, class: "mx-auto h-4 w-4", "aria-label": "Station #{i + 1} is fuel" %>
|
|
</div>
|
|
<% end %>
|
|
<p class="hint">Tick "Fuel" for fuel tanks: their quantity is entered in gallons and the max is the usable capacity. Other maximums are in pounds.</p>
|
|
</fieldset>
|
|
<div class="max-w-xs">
|
|
<%= 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" %>
|
|
<p class="hint">6 for avgas, 6.7 for Jet-A.</p>
|
|
</div>
|
|
<fieldset>
|
|
<legend class="label">CG envelope</legend>
|
|
<p class="hint !mt-0 mb-2">The corners of the normal-category envelope, in order around it (e.g. forward limit at low weight, forward limit at gross, aft limit at gross, aft limit at low weight).</p>
|
|
<div class="grid max-w-sm grid-cols-2 gap-2 text-xs text-slate-500"><span>Weight (lb)</span><span>CG (in)</span></div>
|
|
<% points.each_with_index do |pt, i| %>
|
|
<div class="mt-1 grid max-w-sm grid-cols-2 gap-2">
|
|
<%= text_field_tag "setup[envelope][#{i}][weight]", pt&.first&.to_s&.sub(/\.0\z/, ""), class: "input", inputmode: "decimal", "aria-label": "Envelope point #{i + 1} weight" %>
|
|
<%= text_field_tag "setup[envelope][#{i}][cg]", pt&.last&.to_s&.sub(/\.0\z/, ""), class: "input", inputmode: "decimal", "aria-label": "Envelope point #{i + 1} CG" %>
|
|
</div>
|
|
<% end %>
|
|
</fieldset>
|
|
<div class="flex gap-2"><%= submit_tag "Save", class: "btn-primary" %><%= link_to "Cancel", aircraft_weight_balance_records_path(@aircraft), class: "btn-secondary" %></div>
|
|
<% end %>
|