<% content_for :title, t(".logbook", tail_number: @aircraft.tail_number) %> <%= render "shared/aircraft_header", aircraft: @aircraft %>

<%= t(".maintenance_logbook_html", link: (link_to t(".how_records_and_signing_work"), records_help_path, class: "link ml-2 text-xs font-normal")) %>

<%= form_with url: aircraft_logbook_entries_path(@aircraft), method: :get, class: "flex w-full flex-wrap gap-2 sm:w-auto" do |f| %> <%= f.search_field :q, value: @query, placeholder: t(".search_entries"), class: "input min-w-0 flex-1 sm:w-48 sm:flex-none" %> <%= f.select :log_type, LogbookEntry::LOG_TYPES.invert, { include_blank: t(".all_logs"), selected: @log_type }, class: "input w-32", data: { submit_on_change: true } %> <% if @unverified_count.positive? || @unverified_only %> <% end %> <%= f.submit t(".filter"), class: "sr-only" %> <% end %> <% if @entries.any? %><% end %> <% if owner? %> <%= more_menu do %><%= link_to t(".import_scans"), new_aircraft_logbook_import_path(@aircraft), class: "menu-item" %><% end %> <%= link_to t(".new_entry"), new_aircraft_logbook_entry_path(@aircraft), class: "btn-primary" %> <% end %>
<% if @entries.any? %> <%= form_with url: new_aircraft_logbook_print_path(@aircraft), method: :get, id: "print-entries" do %><% end %>
<% @entries.each do |e| %> <% end %>
" data-check-all> <%= t(".date") %><%= t(".log") %><%= t(".type") %><%= t(".hours") %><%= t(".entry") %><%= t(".signed_off") %>
<%= link_to fmt_date(e.date), aircraft_logbook_entry_path(@aircraft, e), class: "link" %> <%= LogbookEntry::LOG_TYPES[e.log_type] %> <%= LogbookEntry::ENTRY_TYPES[e.entry_type] %> <%= hours(e.aircraft_hours_at_entry) %> <%= e.text.truncate(220) %> <% if e.document %>" aria-label="<%= t(".has_a_scanned_page") %>">📄<% end %> <% unless e.verified? %>; check it against the scan"><%= t(".unverified_2") %><% end %> <%= e.signoff_person %><%= " ##{e.signoff_certificate_number}" if e.signoff_certificate_number %><% if e.signoff_location.present? %>
<%= e.signoff_location %><% end %> <% if e.signature %>
<%= e.superseded? ? t(".superseded") : t(".signed") %> <% elsif (missing = e.missing_record_items).any? %>
<%= t(".incomplete") %><% end %>
<% else %> <%= empty_state(@query.present? ? t(".no_entries_match", query: @query) : t(".no_logbook_entries_yet")) %> <% end %>