mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Existing single attachments migrate to the new list. Photos open in a full-screen viewer (swipe/arrow keys); every file has a download link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.4 KiB
ERB
32 lines
1.4 KiB
ERB
<% content_for :title, "#{@aircraft.tail_number} Squawks" %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<section class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title">Open Squawks</h2>
|
|
<%= link_to "+ Report Squawk", new_aircraft_squawk_path(@aircraft), class: "btn-primary" %>
|
|
</div>
|
|
<% if @active.any? %><%= render "squawks/table", squawks: @active, aircraft: @aircraft %><% else %><%= empty_state "No open squawks." %><% end %>
|
|
</section>
|
|
|
|
<section class="card mt-5">
|
|
<div class="card-header"><h2 class="card-title">Resolved</h2></div>
|
|
<% if @resolved.any? %>
|
|
<table class="table">
|
|
<thead><tr><th>Priority</th><th>Issue</th><th>Resolution</th><th>Resolved</th><th></th></tr></thead>
|
|
<tbody>
|
|
<% @resolved.each do |s| %>
|
|
<tr>
|
|
<td><%= squawk_priority_badge(s) %></td>
|
|
<td><%= s.issue_reported %><%= render "squawks/attachments", squawk: s %></td>
|
|
<td class="text-xs text-slate-600"><%= s.notes %></td>
|
|
<td class="text-xs text-slate-500"><%= s.resolved_at&.to_date %></td>
|
|
<td class="text-right"><% if owner? %><%= button_to "Reopen", reopen_aircraft_squawk_path(@aircraft, s), method: :patch, class: "btn-secondary btn-sm" %><% end %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<%= empty_state "No resolved squawks." %>
|
|
<% end %>
|
|
</section>
|