mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23: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>
51 lines
2.9 KiB
ERB
51 lines
2.9 KiB
ERB
<% content_for :title, t(".documents", tail_number: @aircraft.tail_number) %>
|
||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||
<div class="mb-4 flex flex-wrap justify-end gap-2">
|
||
<% if owner? %>
|
||
<%= more_menu do %>
|
||
<%= link_to t(".upload_several_files"), new_bulk_aircraft_documents_path(@aircraft), class: "menu-item" %>
|
||
<%= link_to t(".new_collection"), new_aircraft_document_collection_path(@aircraft), class: "menu-item" %>
|
||
<% end %>
|
||
<%= link_to t(".upload_document"), new_aircraft_document_path(@aircraft), class: "btn-primary" %>
|
||
<% end %>
|
||
</div>
|
||
<% if @collections.empty? && @uncollected.empty? %>
|
||
<div class="card"><%= empty_state t(".no_documents_yet_upload_logbook") %></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 t(".document"), new_aircraft_document_path(@aircraft, collection_id: col.id), class: "btn-secondary btn-sm" %>
|
||
<%= link_to t(".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 t(".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"><%= t(".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>
|