mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
- Edit on a flight: owners can correct any flight; a pilot, the flights they logged (the same rule as its engine data). - Date, airports, route, notes, oil and fuel (its oil and fuel records follow) and the attached files can always be changed. - The meter readings only on the latest flight, while its tach in is still the aircraft's tach: the aircraft and installed components move by the difference, and with both readings the duration is worked out from them. On earlier flights they're locked (later flights started from them), pointing to Update Hours; the server ignores them too. - Each correction is in the activity log with what changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
758 B
ERB
13 lines
758 B
ERB
<% content_for :title, t(".correct_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| %>
|
|
<h2 class="card-title"><%= t(".correct_the_flight_on", date: fmt_date(@flight_log.date_was)) %></h2>
|
|
<%= f.errors_summary %>
|
|
<%= render "flight_logs/fields", f: f, meters_locked: !@meters_editable %>
|
|
<% if @meters_editable %><p class="hint"><%= t(".changing_the_readings") %></p><% end %>
|
|
<div class="flex flex-wrap gap-2">
|
|
<%= f.submit t(".save"), data: { turbo_submits_with: t("flight_logs.new.sending") } %>
|
|
<%= link_to t(".cancel"), aircraft_flight_log_path(@aircraft, @flight_log), class: "btn-secondary" %>
|
|
</div>
|
|
<% end %>
|