Files
simple-aircraft-manager-rails/app/views/logbook_entries/index.html.erb
T
rickyandClaude Opus 5.5 230a569b77 Markdown notes and a phone-friendly layout
- Notes render GitHub-flavored Markdown (commonmarker, sanitized), with a
  Write/Preview editor; overview shows a plain-text excerpt
- Phone header collapses into a menu; aircraft sections use a dropdown
- Tables stack into labelled cards under 640px (opt out with .table-keep)
- Fix horizontal overflow on overview and logbook; bigger touch targets;
  16px inputs to stop iOS zoom

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

37 lines
2.1 KiB
ERB

<% content_for :title, "#{@aircraft.tail_number} Logbook" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<section class="card">
<div class="card-header">
<h2 class="card-title">Maintenance Logbook</h2>
<div class="flex flex-wrap items-center gap-2">
<%= form_with url: aircraft_logbook_entries_path(@aircraft), method: :get, class: "flex w-full flex-wrap gap-2 sm:w-auto" do |f| %>
<%= f.search_field :q, value: @query, placeholder: "Search entries…", class: "input min-w-0 flex-1 sm:w-48 sm:flex-none" %>
<%= f.select :log_type, LogbookEntry::LOG_TYPES.invert, { include_blank: "All logs", selected: @log_type }, class: "input w-32" %>
<%= f.submit "Filter", class: "btn-secondary" %>
<% end %>
<% if owner? %><%= link_to "Import scans", new_aircraft_logbook_import_path(@aircraft), class: "btn-secondary" %><%= link_to "+ New Entry", new_aircraft_logbook_entry_path(@aircraft), class: "btn-primary" %><% end %>
</div>
</div>
<% if @entries.any? %>
<div class="overflow-x-auto">
<table class="table">
<thead><tr><th>Date</th><th>Log</th><th>Type</th><th class="text-right">Hours</th><th>Entry</th><th>Signed off</th></tr></thead>
<tbody>
<% @entries.each do |e| %>
<tr>
<td class="whitespace-nowrap"><%= link_to e.date, aircraft_logbook_entry_path(@aircraft, e), class: "link" %></td>
<td><span class="badge-gray"><%= LogbookEntry::LOG_TYPES[e.log_type] %></span></td>
<td class="text-xs"><%= LogbookEntry::ENTRY_TYPES[e.entry_type] %></td>
<td class="text-right tabular-nums"><%= hours(e.aircraft_hours_at_entry) %></td>
<td class="max-w-xl"><%= e.text.truncate(220) %> <%= "📄" if e.document %></td>
<td class="text-xs text-slate-500"><%= e.signoff_person %><% if e.signoff_location.present? %><br><%= e.signoff_location %><% end %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% else %>
<%= empty_state(@query.present? ? "No entries match “#{@query}”." : "No logbook entries yet.") %>
<% end %>
</section>