<% content_for :title, t(".export_for_airtrail") %> <%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= form_with url: aircraft_air_trail_export_path(@aircraft), class: "card card-body space-y-4 lg:col-span-2", data: { turbo: false } do |f| %>

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

<% if @export.errors.any? %>
<% end %>
<%= label_tag :username, t(".your_airtrail_username"), class: "label" %> <%= text_field_tag :username, params[:username].presence || @export.as_json[:users].first[:username], class: "input", required: true, autocomplete: "off" %>

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

<%= label_tag :aircraft_type, t(".aircraft_type_icao_optional"), class: "label" %> <%= text_field_tag :aircraft_type, params[:aircraft_type].presence || @aircraft.icao_type, class: "input", placeholder: "C150", maxlength: 4 %>

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

<%= t(".flights") %>
<% all = AirTrailExport.new(@aircraft, username: "preview") %>

<%= t(".ready_to_export_html", flight: (t("counts.flight", count: all.exportable.size))) %><% if all.skipped.positive? %><%= t(".skipped_because_the_from_or_html", skipped: all.skipped) %><% end %>.

<%= f.submit t(".download_airtrail_file"), class: "btn-primary" %> <% end %>

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

  1. <%= t(".in_airtrail_open_settings_import_html") %>
  2. <%= t(".select_the_downloaded_file") %>
  3. <%= t(".map_any_airports_airtrail_doesn") %>

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

<%= t(".prefer_automatic_to_push_new_html", link: (link_to t(".set_up_airtrail_sync"), air_trail_connection_path, class: "link")) %>

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