% content_for :title, "Standardize airport codes" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<% changes = @standardizer.changes %>
<%= form_with url: aircraft_airport_codes_path(@aircraft), method: :patch, class: "space-y-5" do |f| %>
Often a typo. Tick “Fix” and choose the airport these entries should be. Unticked codes are left unchanged.<% if current_user.admin? %> For a private strip that isn't listed, add it as a <%= link_to "custom airport", admin_airports_path, class: "link" %>.<% end %>Standardize airport codes
<%= pluralize(changes.size, "code") %> to update · <%= changes.sum(&:flights) %> entries
<% else %>
<%= empty_state "All logged codes already match the airport database." %>
<% end %>
<% changes.each do |c| %>
Logged Standard Airport Entries
<% end %>
<%= check_box_tag "codes[]", c.from, c.suggested, id: "code_#{c.from.parameterize}" %>
<%= label_tag "code_#{c.from.parameterize}", c.from %>
<%= c.to %>
<%= c.airport.name %> <%= c.airport.place %>
<% if c.note %>
<%= c.flights %>
Not in the airport database