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

Maintenance Logbook

<%= form_with url: aircraft_logbook_entries_path(@aircraft), method: :get, class: "flex gap-2" do |f| %> <%= f.search_field :q, value: @query, placeholder: "Search entries…", class: "input w-48" %> <%= f.select :log_type, LogbookEntry::LOG_TYPES.invert, { include_blank: "All logs", selected: @log_type }, class: "input w-32" %> <%= f.submit "Filter", class: "btn-secondary" %> <% end %> <% if owner? %><%= link_to "+ New Entry", new_aircraft_logbook_entry_path(@aircraft), class: "btn-primary" %><% end %>
<% if @entries.any? %>
<% @entries.each do |e| %> <% end %>
DateLogTypeHoursEntrySigned off
<%= link_to 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 %> <%= e.signoff_person %><% if e.signoff_location.present? %>
<%= e.signoff_location %><% end %>
<% else %> <%= empty_state(@query.present? ? "No entries match “#{@query}”." : "No logbook entries yet.") %> <% end %>