<% content_for :title, "#{@aircraft.tail_number} Documents" %> <%= render "shared/aircraft_header", aircraft: @aircraft %>
<% if owner? %> <%= more_menu do %> <%= link_to "Upload several files", new_bulk_aircraft_documents_path(@aircraft), class: "menu-item" %> <%= link_to "New collection", new_aircraft_document_collection_path(@aircraft), class: "menu-item" %> <% end %> <%= link_to "+ Upload Document", new_aircraft_document_path(@aircraft), class: "btn-primary" %> <% end %>
<% if @collections.empty? && @uncollected.empty? %>
<%= empty_state "No documents yet. Upload logbook scans, 337s, weight & balance, receipts…" %>
<% end %>
<% @collections.each do |col| %>

<%= "★ " if col.starred? %><%= col.name %> (<%= col.documents.size %>)

<% if col.description.present? %>

<%= col.description %>

<% end %>
<%= visibility_badge(col.visibility) %> <% if owner? %> <%= link_to "+ Document", new_aircraft_document_path(@aircraft, collection_id: col.id), class: "btn-secondary btn-sm" %> <%= link_to "Edit", edit_aircraft_document_collection_path(@aircraft, col), class: "btn-secondary btn-sm" %> <% end %>
<% if col.documents.any? %> <% else %><%= empty_state "Empty collection." %><% end %>
<% end %> <% if @uncollected.any? %>

Uncollected (<%= @uncollected.size %>)

<% end %>