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>
30 lines
1.8 KiB
ERB
30 lines
1.8 KiB
ERB
<% content_for :title, t(".print_logbook_entries") %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<%= form_with url: aircraft_logbook_print_path(@aircraft, format: :pdf), method: :get, class: "card card-body max-w-2xl space-y-4",
|
|
data: { turbo: false }, html: { target: "_blank" } do %>
|
|
<div>
|
|
<h2 class="card-title"><%= t(".print_for_the_logbook") %></h2>
|
|
<p class="mt-1 text-sm text-slate-600"><%= t(".a_pdf_of_to_print_html", entry: (t("counts.entry", count: @entries.size)), tail_number: @aircraft.tail_number) %></p>
|
|
</div>
|
|
<% @entries.each do |e| %><%= hidden_field_tag "ids[]", e.id, id: nil %><% end %>
|
|
<ul class="max-h-48 space-y-1 overflow-y-auto rounded-md bg-slate-50 p-3 text-sm">
|
|
<% @entries.each do |e| %>
|
|
<li><span class="font-medium"><%= fmt_date(e.date) %></span> · <%= LogbookEntry::LOG_TYPES[e.log_type] %> · <%= e.text.truncate(90) %>
|
|
<% if (missing = e.missing_record_items).any? %><span class="text-xs text-amber-700"><%= t(".missing_html", to_sentence: missing.to_sentence) %></span><% end %></li>
|
|
<% end %>
|
|
</ul>
|
|
<fieldset class="space-y-2 text-sm">
|
|
<legend class="label"><%= t(".paper") %></legend>
|
|
<% LogbookEntryPdf::LAYOUTS.each do |l| %>
|
|
<label class="flex items-center gap-2"><%= radio_button_tag :layout, l.key, @layout == l.key %> <%= l.label %></label>
|
|
<% end %>
|
|
</fieldset>
|
|
<div class="max-w-xs">
|
|
<%= label_tag :start_at, t(".start_at_label"), class: "label" %>
|
|
<%= number_field_tag :start_at, 1, min: 1, max: 10, class: "input w-24" %>
|
|
<p class="hint"><%= t(".on_a_partly_used_label") %></p>
|
|
</div>
|
|
<p class="hint"><%= t(".print_at_100_actual_size") %></p>
|
|
<div class="flex gap-2"><%= submit_tag t(".open_pdf"), class: "btn-primary" %><%= link_to t(".back"), aircraft_logbook_entries_path(@aircraft), class: "btn-secondary" %></div>
|
|
<% end %>
|