<%= form_with model: [aircraft, collection], class: "card card-body space-y-4 max-w-2xl" do |f| %> <%= f.errors_summary %> <%= f.field :name, required: true %> <%= f.field :description, as: :textarea, rows: 2 %> <%= f.field :visibility, as: :select, label: t(".share_link_visibility"), collection: DocumentCollection::VISIBILITIES.invert %> <%= f.field :starred, as: :checkbox, label: t(".starred_shown_first") %>
<%= f.submit t(".save_collection") %><%= link_to t(".cancel"), aircraft_documents_path(aircraft), class: "btn-secondary" %>
<% end %> <% if collection.persisted? %>
<%= delete_button t(".delete_collection_and_its_documents"), aircraft_document_collection_path(aircraft, collection) %>
<% end %>