Files
simple-aircraft-manager-rails/app/views/documents/index.html.erb
T
rickyandClaude Opus 5.5 3f45b557c2 Secondary actions behind More menus; tidier aircraft header and tabs
- more_menu helper (menu / menu-item styles): each section keeps its main
  action as a button; imports, exports, printing and tools move under More
  (flights, logbook, logbook entry, documents, inspections, fleet)
- Aircraft header: More with status report and, for owners, access &
  sharing, edit, .sam.zip and records package; Access & Sharing and Oil
  Analysis tabs removed (oil analysis is under Oil & Fuel with a switch)
- Logbook: Print selected appears once an entry is ticked; filters apply on
  change; dates use fmt_date (also AirTrail, notes, audits, About)
- Header shows the role on the aircraft and hides the usual Available badge;
  no second Grounded badge on the Overview; AD DRS import listed once
- Flights: stat cards 2x2 on phones; By year opens visibly, only with more
  than one year; duplicate + Log Flight removed
- Remove unused hello_controller.js; guide and README updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:21:57 -05:00

51 lines
2.9 KiB
ERB
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<% 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? %>
<%= 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 %>
</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| %>
<details class="card group document-collection">
<summary class="card-header cursor-pointer list-none border-b-0 group-open:border-b [&::-webkit-details-marker]:hidden">
<div class="flex min-w-0 items-start gap-2">
<span aria-hidden="true" class="mt-0.5 text-slate-400 transition group-open:rotate-90">›</span>
<div class="min-w-0">
<h2 class="card-title"><%= "★ " if col.starred? %><%= col.name %> <span class="text-sm font-normal text-slate-500">(<%= col.documents.size %>)</span></h2>
<% if col.description.present? %><p class="text-xs text-slate-500"><%= col.description %></p><% end %>
</div>
</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>
</summary>
<% 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 %>
</details>
<% end %>
<% if @uncollected.any? %>
<details class="card group document-collection">
<summary class="card-header cursor-pointer list-none border-b-0 group-open:border-b [&::-webkit-details-marker]:hidden">
<div class="flex items-start gap-2">
<span aria-hidden="true" class="mt-0.5 text-slate-400 transition group-open:rotate-90">›</span>
<h2 class="card-title">Uncollected <span class="text-sm font-normal text-slate-500">(<%= @uncollected.size %>)</span></h2>
</div>
</summary>
<ul class="divide-y divide-slate-100"><% @uncollected.each do |doc| %><%= render "documents/doc_row", doc: doc, aircraft: @aircraft %><% end %></ul>
</details>
<% end %>
</div>