Files
simple-aircraft-manager-rails/app/views/documents/index.html.erb
T
rickyandClaude Opus 5.5 2bfcb845ca Bulk document upload and deduplicated file storage
- Bulk Upload page: pick many files or a folder; each file becomes a
  document named after it, and files sharing a name become one multi-page
  document. Files go up as direct uploads with per-file progress.
- Direct uploads require a signed-in user and check type/size up front;
  only fresh, unattached blobs can be attached; abandoned uploads are
  purged nightly.
- DedupDisk storage service: each distinct file is stored once under its
  SHA-256 and blobs hard-link to it; nightly sweep (and storage:dedupe)
  links pre-existing duplicates and drops unused objects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 08:20:22 -05:00

41 lines
2.0 KiB
ERB

<% content_for :title, "#{@aircraft.tail_number} Documents" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<div class="mb-4 flex flex-wrap justify-end gap-2">
<% if owner? %>
<%= link_to "+ Collection", new_aircraft_document_collection_path(@aircraft), class: "btn-secondary" %>
<%= link_to "Bulk Upload", new_bulk_aircraft_documents_path(@aircraft), class: "btn-secondary" %>
<%= link_to "+ Upload Document", new_aircraft_document_path(@aircraft), class: "btn-primary" %>
<% end %>
</div>
<% if @collections.empty? && @uncollected.empty? %>
<div class="card"><%= empty_state "No documents yet. Upload logbook scans, 337s, weight & balance, receipts…" %></div>
<% end %>
<div class="space-y-5">
<% @collections.each do |col| %>
<section class="card">
<div class="card-header">
<div>
<h2 class="card-title"><%= "★ " if col.starred? %><%= col.name %></h2>
<% if col.description.present? %><p class="text-xs text-slate-500"><%= col.description %></p><% end %>
</div>
<div class="flex items-center gap-2">
<%= 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 %>
</div>
</div>
<% if col.documents.any? %>
<ul class="divide-y divide-slate-100"><% col.documents.sort_by(&:name).each do |doc| %><%= render "documents/doc_row", doc: doc, aircraft: @aircraft %><% end %></ul>
<% else %><%= empty_state "Empty collection." %><% end %>
</section>
<% end %>
<% if @uncollected.any? %>
<section class="card">
<div class="card-header"><h2 class="card-title">Uncollected</h2></div>
<ul class="divide-y divide-slate-100"><% @uncollected.each do |doc| %><%= render "documents/doc_row", doc: doc, aircraft: @aircraft %><% end %></ul>
</section>
<% end %>
</div>