<%= render "logbook_entries/draft_batch", entry: @entry %>
<% if @entry.signed? %><%= render "logbook_entries/signature", entry: @entry %>
<% elsif LogbookEntry::RECORD_TYPES.include?(@entry.entry_type) %>
<%= t(".not_signed_electronically_sign_it_html", supersedes: (t(".pending_correction_of_the_entry", date: (fmt_date(@entry.supersedes.date))) if @entry.supersedes)) %>
<% end %>
<% unless @entry.verified? %>
<%= t(".transcribed_by_claude_and_not_html", transcription_confidence: (t(".confidence", transcription_confidence: @entry.transcription_confidence) if @entry.transcription_confidence), logbook: (@entry.document ? "" : t(".or_the_paper_logbook"))) %>
<% if owner? %><%= button_to t(".matches_the_scan_mark_verified"), verify_aircraft_logbook_entry_path(@aircraft, @entry), method: :patch, class: "btn-secondary btn-sm" %><% end %>
<% end %>
<%= t(".type_html", entry_type: (LogbookEntry::ENTRY_TYPES[@entry.entry_type])) %>
<%= t(".airframe_total_time_html", aircraft_hours_at_entry: (hours(@entry.aircraft_hours_at_entry))) %>
<% if (c = @entry.component) %>
<%= c %> <%= c.model %><%= " S/N #{c.serial_number}" if c.serial_number.present? %>:
<%= t(".total_html", component_hours_at_entry: (hours(@entry.component_hours_at_entry)), component_since_overhaul_at_entry: (hours(@entry.component_since_overhaul_at_entry)), since_overhaul_abbreviation: c.since_overhaul_abbreviation) %>
<% end %>
<% @entry.parts.each do |part| %>
<% pc = part.component %>
<%= pc %> <%= pc.model %><%= " S/N #{pc.serial_number}" if pc.serial_number.present? %>:
<%= t(".total_2_html", hours_at_entry: (hours(part.hours_at_entry)), since_overhaul_at_entry: (hours(part.since_overhaul_at_entry)), since_overhaul_abbreviation: pc.since_overhaul_abbreviation.downcase) %>
<% end %>
<%= @entry.text %>
<%= t(".signed_off_html", signoff_person: (@entry.signoff_person.presence || "—")) %>
<%= ", #{@entry.certificate_label}" if @entry.certificate_label %><%= " ##{@entry.signoff_certificate_number}" if @entry.signoff_certificate_number %>
<%= "(#{@entry.signoff_location})" if @entry.signoff_location.present? %>
<% if @entry.inspection_result %>
<%= t(".result_html", inspection_result_label: @entry.inspection_result_label) %>
<% end %>
<% if (missing = @entry.missing_record_items).any? %>
<%= t(".missing_for_html", entry_type: (@entry.entry_type == "INSPECTION" ? "43.11" : "43.9"), items: missing.to_sentence) %>
<%= link_to(t(".fill_in"), edit_aircraft_logbook_entry_path(@aircraft, @entry), class: "link") if owner? %>
<%= t(".check_against_the_signed_logbook") %>
<% end %>
<% if @entry.document %>
<%= t(".scan_html", link: (link_to @entry.document.name, aircraft_document_path(@aircraft, @entry.document, page: @entry.page_number), class: "link"), page_number: (t(".page", page_number: @entry.page_number) if @entry.page_number)) %>
<% end %>