<% content_for :title, "#{@aircraft.tail_number} Logbook" %> <%= render "shared/aircraft_header", aircraft: @aircraft %>

Maintenance Logbook <%= link_to "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: "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: "All logs", selected: @log_type }, class: "input w-32", data: { submit_on_change: true } %> <% if @unverified_count.positive? || @unverified_only %> <% end %> <%= f.submit "Filter", class: "sr-only" %> <% end %> <% if @entries.any? %><% end %> <% if owner? %> <%= more_menu do %><%= link_to "Import scans", new_aircraft_logbook_import_path(@aircraft), class: "menu-item" %><% end %> <%= link_to "+ 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 %>
DateLogTypeHoursEntrySigned 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 %>📄<% end %> <% unless e.verified? %>; check it against the scan">Unverified<% 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? ? "Superseded" : "Signed" %> <% elsif (missing = e.missing_record_items).any? %>
Incomplete<% end %>
<% else %> <%= empty_state(@query.present? ? "No entries match “#{@query}”." : "No logbook entries yet.") %> <% end %>