mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Shared records keep applicability in join tables, so linking to the airframe or a component, unlinking, edits to the shared record and a component's deletion are now appended to each affected aircraft's hash chain. Owners can restore a removed link from Activity -> Record history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
940 B
ERB
15 lines
940 B
ERB
<% content_for :title, "#{@aircraft.tail_number} Record history" %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<section class="card">
|
|
<div class="card-header">
|
|
<div>
|
|
<h2 class="card-title">Record history</h2>
|
|
<p class="text-xs text-slate-500">Every change to the maintenance records, kept for good and chained so that removing or altering history shows in the nightly check.</p>
|
|
</div>
|
|
<%= form_with url: aircraft_record_versions_path(@aircraft), method: :get, class: "flex gap-2" do %>
|
|
<%= select_tag :type, options_for_select([ [ "All records", "" ] ] + @types.map { [ _1.underscore.humanize, _1 ] }, @type), class: "input w-48", data: { submit_on_change: true } %>
|
|
<% end %>
|
|
</div>
|
|
<% if @versions.any? %><%= render "record_versions/list", versions: @versions, aircraft: @aircraft, can_restore: owner? %><% else %><%= empty_state "No changes recorded yet." %><% end %>
|
|
</section>
|