% content_for :title, t(".documents", tail_number: @aircraft.tail_number) %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<% if owner? %>
<%= more_menu do %>
<%= link_to t(".upload_several_files"), new_bulk_aircraft_documents_path(@aircraft), class: "menu-item" %>
<%= link_to t(".new_collection"), new_aircraft_document_collection_path(@aircraft), class: "menu-item" %>
<% end %>
<%= link_to t(".upload_document"), new_aircraft_document_path(@aircraft), class: "btn-primary" %>
<% end %>
<% if @collections.empty? && @uncollected.empty? %>
<%= empty_state t(".no_documents_yet_upload_logbook") %>
<% end %>
<% @collections.each do |col| %>
<% if col.documents.any? %>
<% col.documents.sort_by(&:name).each do |doc| %><%= render "documents/doc_row", doc: doc, aircraft: @aircraft %><% end %>
<% else %><%= empty_state t(".empty_collection") %><% end %>
<% end %>
<% if @uncollected.any? %>
<% @uncollected.each do |doc| %><%= render "documents/doc_row", doc: doc, aircraft: @aircraft %><% end %>
<% end %>