mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
- Views use lazy t(".key") lookups; sentences with values or links stay
whole (interpolation, _html keys); counts use one/other plurals
- Stored-value labels (statuses, types, priorities...) are LabelSets read
from labels: in the current locale; field names and validation messages
under activerecord:; flash and activity text under flash:
- Services, models, helpers, mailer subjects, the logbook PDF, procedures
templates, records package README and transcription warnings localized;
the PDF reuses LogbookEntry#certification_statement instead of a copy
- Scripts read js: strings from a JSON tag via app/javascript/i18n.js
- Dates through I18n.l (app, weekday, month_year, long formats); html lang
follows the locale
- APP_LOCALE picks the language (falls back to English); missing
translations raise in development and tests
- README: Translating section and APP_LOCALE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.7 KiB
ERB
32 lines
1.7 KiB
ERB
<% content_for :title, t(".squawks", tail_number: @aircraft.tail_number) %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<section class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title"><%= t(".open_squawks") %></h2>
|
|
<%= link_to t(".report_squawk"), new_aircraft_squawk_path(@aircraft), class: "btn-primary" %>
|
|
</div>
|
|
<% if @active.any? %><%= render "squawks/table", squawks: @active, aircraft: @aircraft %><% else %><%= empty_state t(".no_open_squawks") %><% end %>
|
|
</section>
|
|
|
|
<section class="card mt-5">
|
|
<div class="card-header"><h2 class="card-title"><%= t(".resolved") %></h2></div>
|
|
<% if @resolved.any? %>
|
|
<table class="table">
|
|
<thead><tr><th><%= t(".priority") %></th><th><%= t(".issue") %></th><th><%= t(".resolution") %></th><th><%= t(".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 %><% if s.logbook_entry %><div><%= link_to t(".logbook", date: fmt_date(s.logbook_entry.date)), aircraft_logbook_entry_path(@aircraft, s.logbook_entry), class: "link" %></div><% end %></td>
|
|
<td class="text-xs text-slate-500"><%= fmt_date(s.resolved_at&.to_date) %></td>
|
|
<td class="text-right"><% if owner? %><%= button_to t(".reopen"), reopen_aircraft_squawk_path(@aircraft, s), method: :patch, class: "btn-secondary btn-sm" %><% end %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<%= empty_state t(".no_resolved_squawks") %>
|
|
<% end %>
|
|
</section>
|