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>
44 lines
3.2 KiB
ERB
44 lines
3.2 KiB
ERB
<% content_for :title, t(".log_flight") %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<%= form_with model: [@aircraft, @flight_log], class: "card card-body space-y-5 max-w-3xl",
|
|
data: { controller: "offline-flight", offline_flight_tail_value: @aircraft.tail_number,
|
|
action: "submit->offline-flight#submit turbo:submit-start->offline-flight#remember turbo:fetch-request-error->offline-flight#networkFailed turbo:before-fetch-response->offline-flight#gatewayFailed" } do |f| %>
|
|
<%= f.hidden_field :client_key, data: { offline_flight_target: "key" } %>
|
|
<div class="hidden rounded-md bg-sky-50 px-3 py-2 text-sm text-sky-900 ring-1 ring-sky-200" data-offline-flight-target="notice" role="status"></div>
|
|
<%= f.errors_summary %>
|
|
<div class="grid gap-4 sm:grid-cols-3">
|
|
<%= f.field :date, as: :date, required: true %>
|
|
<%= render "shared/airport_field", f: f, attribute: :departure_location, label: t(".from"), aircraft: @aircraft, placeholder: t(".koqu") %>
|
|
<%= render "shared/airport_field", f: f, attribute: :destination_location, label: t(".to"), aircraft: @aircraft, placeholder: t(".code_or_name") %>
|
|
</div>
|
|
<fieldset class="grid gap-4 sm:grid-cols-3">
|
|
<legend class="mb-2 text-sm font-semibold"><%= t(".tach_required") %></legend>
|
|
<%= f.field :tach_out, as: :number, step: 0.1, label: t(".tach_out") %>
|
|
<%= f.field :tach_in, as: :number, step: 0.1, label: t(".tach_in") %>
|
|
<%= f.field :tach_time, as: :number, step: 0.1, label: t(".or_duration"), hint: t(".calculated_from_out_in_if") %>
|
|
</fieldset>
|
|
<fieldset class="grid gap-4 sm:grid-cols-3">
|
|
<legend class="mb-2 text-sm font-semibold"><%= t(".hobbs_optional") %></legend>
|
|
<%= f.field :hobbs_out, as: :number, step: 0.1, label: t(".hobbs_out") %>
|
|
<%= f.field :hobbs_in, as: :number, step: 0.1, label: t(".hobbs_in") %>
|
|
<%= f.field :hobbs_time, as: :number, step: 0.1, label: t(".or_duration") %>
|
|
</fieldset>
|
|
<fieldset class="grid gap-4 sm:grid-cols-3">
|
|
<legend class="mb-2 text-sm font-semibold"><%= t(".oil_fuel_added") %></legend>
|
|
<%= f.field :oil_added, as: :number, step: 0.25, label: t(".oil_added_qt") %>
|
|
<%= f.field :oil_level_after, as: :number, step: 0.25, label: t(".oil_level_after_qt") %>
|
|
<%= f.field :oil_added_type, label: t(".oil_type"), placeholder: t(".aeroshell_w100") %>
|
|
<%= f.field :fuel_added, as: :number, step: 0.1, label: t(".fuel_added_gal") %>
|
|
<%= f.field :fuel_level_after, as: :number, step: 0.1, label: t(".fuel_level_after_gal") %>
|
|
<%= f.field :fuel_added_type, label: t(".fuel_type"), placeholder: t(".n100ll") %>
|
|
</fieldset>
|
|
<%= f.field :route, as: :textarea, rows: 2 %>
|
|
<%= f.field :notes, as: :textarea, rows: 2 %>
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
<%= f.field :track_log, as: :file, label: t(".track_log_gpx_kml_csv") %>
|
|
<%= f.field :engine_data, as: :file, label: t(".engine_monitor_data"), hint: t(".cgr_30p_cgr_30c_flight"), accept: ".csv,text/csv" %>
|
|
</div>
|
|
<p class="hint"><%= t(".saving_adds_the_tach_time") %></p>
|
|
<div class="flex gap-2"><%= f.submit t(".log_flight") %><%= link_to t(".cancel"), aircraft_flight_logs_path(@aircraft), class: "btn-secondary" %></div>
|
|
<% end %>
|