<% content_for :title, t(".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 %>

<%= t(".preview_html", filename: @filename) %>

<%= t(".found_with_drs_links_html", rows: (t("counts.ad", count: rows.size)), url: (rows.count(&:url))) %>
<% if rows.none?(&:url) %>

<%= t(".this_file_has_no_links_html") %>

<% end %>

<%= t(".choose_what_to_do_with_html", model: (@aircraft.model.presence || t(".not_set"))) %>

<% rows.each do |r| %> <% end %>
<%= t(".ad") %><%= t(".subject") %><%= t(".effective") %><%= t(".notes") %><%= t(".action") %>
<%= r.number %><%= link_to " 🔗", r.url, target: "_blank", rel: "noopener noreferrer", title: t(".link_found_in_file") if r.url %> <% if r.product_type %>
<%= r.product_type %>
<% end %>
<%= r.subject %> <% if r.summary %>
<%= t(".summary") %><%= r.summary %>
<% end %>
<%= fmt_date(r.effective_date) %> <% r.notes.each do |n| %>
">• <%= n %>
<% end %>
<% choices = r.tracked ? [ [ t(".update"), "track" ], [ t(".not_applicable"), "na" ], [ t(".skip_leave_as_is"), "skip" ] ] : AdImport::ACTIONS.invert %> <%= select_tag "decisions[#{r.number}]", options_for_select(choices, r.suggested), class: "input" %>
<%= f.submit t(".import_ads"), class: "btn-primary", data: { turbo_confirm: t(".import_these_ads_to", tail_number: @aircraft.tail_number) } %> <%= link_to t(".upload_a_different_file"), new_aircraft_ad_import_path(@aircraft), class: "btn-secondary" %>
<% end %>