% content_for :title, t(".aircraft_import") %> <% if @import.in_progress? %><% content_for :head, tag.meta("http-equiv": "refresh", content: "2") %><% end %>
<%= @import.filename %><%= t(".from", source: @import.source) if @import.source.present? %>
<% if @import.in_progress? %><%= @import.status == "queued" ? t(".waiting_to_start") : t(".importing_2") %>
<% if @import.counts.any? %><%= t(".so_far_html", summary: @import.summary) %>
<% end %><%= t(".this_page_updates_by_itself") %>
<% elsif @import.done? %><%= t(".imported") %>
<%= @import.summary.presence&.upcase_first || t(".no_records") %>.
<% if @import.aircraft %><%= link_to t(".open", tail_number: @import.aircraft.tail_number), aircraft_path(@import.aircraft), class: "btn-primary" %>
<% end %> <% else %><%= t(".the_import_failed_nothing_was") %>
<%= @import.error %>
<%= link_to t(".try_another_file"), new_aircraft_import_path, class: "btn-secondary" %>
<% end %> <% if @import.warnings.any? %><%= t("counts.note", count: @import.warnings.size) %>