<% content_for :title, @aircraft.tail_number %>
<% if @aircraft.picture.attached? %><%= image_tag rails_blob_path(@aircraft.picture, disposition: :inline), class: "h-16 w-16 rounded-md object-cover" %><% end %>

<%= @aircraft.tail_number %> <%= [@aircraft.make, @aircraft.model].compact_blank.join(" ") %>

<%= airworthiness_badge(@airworthiness) %> <%= aircraft_status_badge(@aircraft) %> Tach <%= hours(@aircraft.tach_time) %> · Hobbs <%= hours(@aircraft.hobbs_time) %>
Shared view · <%= ShareToken::PRIVILEGES[@share.privilege] %>

Airworthiness

<%= airworthiness_badge(@airworthiness, large: true) %>
<% if @airworthiness.issues.empty? %>

No open issues.

<% else %>
    <% @airworthiness.issues.each do |i| %>
  • <%= i.category %> <%= i.title %> <%= i.description %>
  • <% end %>
<% end %>

Open Squawks

<% if @active_squawks.any? %>
    <% @active_squawks.each do |s| %>
  • <%= squawk_priority_badge(s) %> <%= s.issue_reported %>
  • <% end %>
<% else %><%= empty_state "None." %><% end %>

Consumption

<%= @oil.recent || "—" %>
Oil hrs/qt (recent)
<%= @fuel.recent || "—" %>
Fuel gal/hr (recent)

Components

<% @components.each do |c| %><% end %>
ComponentMake / ModelIn serviceSince OH/svcTBOLife
<%= c %><%= c.manufacturer %> <%= c.model %> <%= hours(c.hours_in_service) %><%= hours(c.hours_since_overhaul) %> <%= c.tbo_hours %><%= life_badge(c.life_status) %>

Inspections

<% @inspection_rows.each do |r| %><% end %>
<%= r.type.name %><%= r.latest&.date || "—" %><%= compliance_badge(r.status) %>

ADs

<% @ad_rows.each do |r| %><% end %>
<%= ad_link(r.ad) %>
<%= r.ad.short_description %>
<%= r.latest&.date_complied || "—" %><%= compliance_badge(r.status) %>
<% if @notes.any? %>

Notes

<% end %> <% if @documents.any? %>

Documents

<% end %> <% if @share.maintenance? %>

Logbook

<% if @logbook.any? %><% @logbook.each do |e| %><% end %>
<%= e.date %><%= LogbookEntry::LOG_TYPES[e.log_type] %> <%= hours(e.aircraft_hours_at_entry) %><%= e.text %><%= e.signoff_person %>
<% else %><%= empty_state "No entries." %><% end %>

Inspection History

<% @inspection_history.each do |r| %><% end %>
<%= r.date %><%= r.inspection_type.name %><%= hours(r.hours_at_inspection) %>

AD Compliance History

<% @ad_history.each do |c| %><% end %>
<%= c.date_complied %><%= ad_link(c.airworthiness_directive) %>
<%= c.airworthiness_directive.short_description %>
<%= c.not_applicable? ? "N/A: " : "" %><%= c.compliance_notes %>

Major Repairs & Alterations

<% if @major_records.any? %><% @major_records.each do |r| %><% end %>
<%= r.date_performed %><%= r.type_label %><%= r.title %>
<%= r.description %>
<%= r.stc_number %>
<% else %><%= empty_state "None recorded." %><% end %>

Resolved Squawks

<% if @resolved_squawks.any? %> <% else %><%= empty_state "None." %><% end %>
<% end %>