<%# Header + tab bar shown on every aircraft page. %> <% aw = aircraft.airworthiness %>
<% if aircraft.picture.attached? %> <%= image_tag aircraft.picture, class: "h-12 w-12 rounded-md object-cover", alt: "" %> <% end %>

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

<%= airworthiness_badge(aw) %> <%= aircraft_status_badge(aircraft) unless aircraft.status == "AVAILABLE" %> Tach <%= hours(aircraft.tach_time) %> · Hobbs <%= hours(aircraft.hobbs_time) %> <%= (current_user.aircraft_roles.find_by(aircraft: aircraft)&.role || current_role).capitalize %>
<%= link_to "Log Flight", new_aircraft_flight_log_path(aircraft), class: "btn-primary" %> <%= link_to "Report Squawk", new_aircraft_squawk_path(aircraft), class: "btn-secondary" %> <%= more_menu do %> <%= link_to "Status report", aircraft_report_path(aircraft), class: "menu-item" %> <% if owner? %> <%= link_to "Access & sharing", aircraft_aircraft_roles_path(aircraft), class: "menu-item" %> <%= link_to "Edit aircraft", edit_aircraft_path(aircraft), class: "menu-item" %> <%= link_to "Download .sam.zip", aircraft_export_path(aircraft), class: "menu-item", data: { turbo: false } %> <%= link_to "Download records package", aircraft_records_package_path(aircraft), class: "menu-item", data: { turbo: false } %> <% end %> <% end %>
<% tabs = aircraft_tabs(aircraft) %> <% current_tab = tabs.find { |_, _, names| names.include?(controller_name) } %> <%# Phones: the current section, with every section a tap away. %>
Section
<%= current_tab&.first || "Choose a section" %>