%# Engine / propeller (or other component) the entry is for, and its times at the entry. %>
<% comps = aircraft.components.where.not(status: "DISPOSED").includes(:component_type).order(:install_location) %>
<%# Sub-components of the chosen component (oil filter, magnetos…): tick to include them with their times. %>
<% children = comps.select(&:parent_component_id) %>
<% if children.any? %>
<% parts = f.object.parts.index_by(&:component_id) %>
<% selected = f.object.component %>
<% end %>