<% content_for :title, "Resolve squawk" %> <%= render "shared/aircraft_header", aircraft: @aircraft %> <%= form_with url: resolve_aircraft_squawk_path(@aircraft, @squawk), method: :patch, class: "card card-body max-w-3xl space-y-4" do %>

Resolve squawk

<%= @squawk.issue_reported %><%= " · #{@squawk.component}" if @squawk.component %>

<% if @entry.errors.any? %> <% end %> <% choice = params[:logbook].presence || "new" %>
Logbook

For a new entry. 14 CFR 43.9: what was done, the date, and the name, certificate number and kind of certificate of whoever approved the return to service.

<%= fields_for :logbook_entry, @entry do |f| %>
<%= f.field :date, as: :date %> <%= f.field :log_type, as: :select, label: "Logbook", collection: LogbookEntry::LOG_TYPES.invert %> <%= f.field :aircraft_hours_at_entry, as: :number, step: 0.1, label: "Aircraft hours" %>
<%= f.field :text, as: :textarea, label: "Work performed", rows: 3 %>
<%= f.field :signoff_person, label: "Signed off by" %> <%= f.field :signoff_certificate_type, as: :select, label: "Kind of certificate", include_blank: "—", collection: LogbookEntry::CERTIFICATE_TYPES.invert %> <%= f.field :signoff_certificate_number, label: "Certificate number" %>
<% end %>
<%= label_tag :resolution_notes, "Resolution notes (optional)", class: "label" %> <%= text_area_tag :resolution_notes, params[:resolution_notes], rows: 2, class: "input" %>
<%= submit_tag "Resolve", class: "btn-primary" %><%= link_to "Cancel", aircraft_squawks_path(@aircraft), class: "btn-secondary" %>
<% end %>