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>
50 lines
2.7 KiB
ERB
50 lines
2.7 KiB
ERB
<% content_for :title, t(".defer_inoperative_item") %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<%= form_with url: defer_aircraft_squawk_path(@aircraft, @squawk), method: :patch, class: "card card-body max-w-2xl space-y-4" do %>
|
|
<div>
|
|
<h2 class="card-title"><%= t(".defer_as_inoperative_14_cfr") %></h2>
|
|
<p class="mt-1 text-sm text-slate-600"><%= t(".without_a_minimum_equipment_list") %></p>
|
|
</div>
|
|
<div class="rounded-md bg-slate-50 p-3 text-sm"><span class="font-medium"><%= t(".item") %></span> <%= @squawk.issue_reported %><%= " · #{@squawk.component}" if @squawk.component %></div>
|
|
<% if @squawk.errors.any? %>
|
|
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200" role="alert">
|
|
<ul class="list-disc pl-5"><% @squawk.errors.full_messages.each do |m| %><li><%= m %></li><% end %></ul>
|
|
</div>
|
|
<% end %>
|
|
<fieldset class="space-y-2">
|
|
<legend class="label"><%= t(".confirm_each_one") %></legend>
|
|
<% Squawk::DEFERRAL_CHECKS.each do |key, text| %>
|
|
<label class="flex items-start gap-2 text-sm">
|
|
<%= check_box_tag "checks[]", key, Array(params[:checks]).include?(key), id: "check_#{key}", class: "mt-0.5 h-4 w-4 shrink-0 rounded border-slate-300" %>
|
|
<span><%= text %></span>
|
|
</label>
|
|
<% end %>
|
|
</fieldset>
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<%= label_tag :deferral_action, t(".what_was_done"), class: "label" %>
|
|
<%= select_tag :deferral_action, options_for_select(Squawk::DEFERRAL_ACTIONS.invert, params[:deferral_action] || @squawk.deferral_action), class: "input" %>
|
|
<p class="hint"><%= t(".deactivating_or_removing_it_is") %></p>
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-2">
|
|
<div>
|
|
<%= label_tag :deferred_by_name, t(".determined_by"), class: "label" %>
|
|
<%= text_field_tag :deferred_by_name, params[:deferred_by_name] || current_user.display_name, class: "input", required: true %>
|
|
</div>
|
|
<div>
|
|
<%= label_tag :deferred_by_role, t(".as"), class: "label" %>
|
|
<%= select_tag :deferred_by_role, options_for_select(Squawk::DEFERRAL_ROLES.invert,
|
|
params[:deferred_by_role] || (current_user.certificates.any?(&:mechanic?) ? "mechanic" : "pilot")), class: "input" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<%= label_tag :deferral_notes, t(".notes"), class: "label" %>
|
|
<%= text_area_tag :deferral_notes, params[:deferral_notes], rows: 2, class: "input", placeholder: t(".e_g_breaker_pulled_and") %>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<%= submit_tag t(".defer_item"), class: "btn-primary" %>
|
|
<%= link_to t(".cancel"), aircraft_squawks_path(@aircraft), class: "btn-secondary" %>
|
|
</div>
|
|
<% end %>
|