% content_for :title, "AD Import Preview" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<% rows = @import.rows %>
<%= form_with url: confirm_aircraft_ad_import_path(@aircraft), class: "space-y-5" do |f| %>
<%= hidden_field_tag :token, @token %>
<%= hidden_field_tag :filename, @filename %>
This file has no links to the AD documents. DRS's Excel export includes them; import that file instead (or afterwards) to get clickable AD numbers. Choose what to do with each AD. The suggestions are based on the FAA data and your aircraft's model (<%= @aircraft.model.presence || "not set" %>); you make the call.Preview: <%= @filename %>
<%= pluralize(rows.size, "AD") %> found · <%= rows.count(&:url) %> with DRS links
<% rows.each do |r| %>
AD Subject Effective Notes Action
<% end %>
<%= r.number %><%= link_to " 🔗", r.url, target: "_blank", rel: "noopener noreferrer", title: "Link found in file" if r.url %>
<% if r.product_type %>
<%= r.subject %>
<% if r.summary %>
Summary
<%= r.summary %><%= r.effective_date %>
<% r.notes.each do |n| %>
<% choices = r.tracked ? [ [ "Update", "track" ], [ "Not applicable", "na" ], [ "Skip (leave as is)", "skip" ] ] : AdImport::ACTIONS.invert %>
<%= select_tag "decisions[#{r.number}]", options_for_select(choices, r.suggested), class: "input" %>