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
2.2 KiB
ERB
30 lines
2.2 KiB
ERB
<%= form_with model: ad, url: ad.new_record? ? aircraft_airworthiness_directives_path(aircraft) : aircraft_airworthiness_directive_path(aircraft, ad), class: "card card-body space-y-4 max-w-3xl" do |f| %>
|
|
<%= f.errors_summary %>
|
|
<div class="grid gap-4 sm:grid-cols-3">
|
|
<%= f.field :name, label: t(".number"), required: true, placeholder: "2011-10-09" %>
|
|
<%= f.field :bulletin_type, as: :select, label: t(".type"), collection: AirworthinessDirective::BULLETIN_TYPES.invert %>
|
|
<%= f.field :compliance_type, as: :select, label: t(".compliance"), collection: AirworthinessDirective::COMPLIANCE_TYPES.invert,
|
|
hint: t(".conditional_ads_only_apply_when") %>
|
|
</div>
|
|
<%= f.field :short_description, required: true %>
|
|
<%= f.field :required_action, as: :textarea, rows: 3 %>
|
|
<%= f.field :trigger_condition, as: :textarea, rows: 2, hint: t(".for_conditional_ads_e_g") %>
|
|
<div class="flex gap-6">
|
|
<%= f.field :mandatory, as: :checkbox, label: t(".mandatory") %>
|
|
<%= f.field :recurring, as: :checkbox, label: t(".recurring") %>
|
|
</div>
|
|
<div class="grid gap-4 sm:grid-cols-3">
|
|
<%= f.field :recurring_hours, as: :number, step: 0.1, label: t(".every_hours") %>
|
|
<%= f.interval :recurring, label: t(".every"), hint: t(".months_and_years_are_due") %>
|
|
<%= f.field :document_id, as: :select, label: t(".reference_document"), collection: document_options(aircraft) %>
|
|
</div>
|
|
<%= f.field :document_url, label: t(".link_to_ad_document"), placeholder: t(".https"),
|
|
hint: t(".filled_in_automatically_from_a") %>
|
|
<%= render "shared/applicability_fields", aircraft: aircraft, record: ad, applies_to_airframe: @applies_to_airframe %>
|
|
<% if ad.persisted? && (ad.aircraft.count + ad.components.where.not(aircraft_id: aircraft.id).count) > 1 %>
|
|
<p class="rounded bg-amber-50 p-2 text-xs text-amber-800"><%= t(".this_ad_is_shared_with") %></p>
|
|
<% end %>
|
|
<div class="flex gap-2"><%= f.submit t(".save") %><%= link_to t(".cancel"), aircraft_airworthiness_directives_path(aircraft), class: "btn-secondary" %></div>
|
|
<% end %>
|
|
<% if ad.persisted? %><div class="mt-4"><%= delete_button t(".remove_from", tail_number: aircraft.tail_number), aircraft_airworthiness_directive_path(aircraft, ad) %></div><% end %>
|