mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Move all user-facing text into config/locales/en.yml for localization
- 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>
This commit is contained in:
1 parent
3f45b557c2
commit
89ed0a76f9
313 files changed
+6387
-2653
No files matched your search
@@ -8,44 +8,44 @@
|
||||
<% photos.each do |file| %>
|
||||
<li class="inline-flex items-center overflow-hidden rounded-md text-xs ring-1 ring-slate-300">
|
||||
<%= link_to rails_blob_path(file, disposition: :inline), class: "px-2 py-1 text-sky-700 hover:bg-slate-100",
|
||||
title: "Preview #{file.filename}",
|
||||
title: t(".preview", filename: file.filename),
|
||||
data: { gallery_target: "item", action: "gallery#open", gallery_name: file.filename.to_s,
|
||||
gallery_download: rails_blob_path(file, disposition: :attachment) } do %>
|
||||
🖼 <%= file.filename.to_s.truncate(28, omission: "…") %>
|
||||
<% end %>
|
||||
<%= link_to "⬇", rails_blob_path(file, disposition: :attachment), download: file.filename.to_s,
|
||||
class: "border-l border-slate-300 px-1.5 py-1 text-slate-500 hover:bg-slate-100 hover:text-sky-700",
|
||||
title: "Download #{file.filename}", aria: { label: "Download #{file.filename}" } %>
|
||||
title: t(".download", filename: file.filename), aria: { label: t(".download", filename: file.filename) } %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% others.each do |file| %>
|
||||
<li class="inline-flex items-center overflow-hidden rounded-md text-xs ring-1 ring-slate-300">
|
||||
<%= link_to "📎 #{file.filename.to_s.truncate(28, omission: "…")}", rails_blob_path(file, disposition: :inline),
|
||||
class: "px-2 py-1 text-sky-700 hover:bg-slate-100", target: "_blank", rel: "noopener", title: "Open #{file.filename}" %>
|
||||
class: "px-2 py-1 text-sky-700 hover:bg-slate-100", target: "_blank", rel: "noopener", title: t(".open", filename: file.filename) %>
|
||||
<%= link_to "⬇", rails_blob_path(file, disposition: :attachment), download: file.filename.to_s,
|
||||
class: "border-l border-slate-300 px-1.5 py-1 text-slate-500 hover:bg-slate-100 hover:text-sky-700",
|
||||
title: "Download #{file.filename}", aria: { label: "Download #{file.filename}" } %>
|
||||
title: t(".download", filename: file.filename), aria: { label: t(".download", filename: file.filename) } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if photos.any? %>
|
||||
<dialog data-gallery-target="dialog" aria-label="Photo viewer"
|
||||
<dialog data-gallery-target="dialog" aria-label="<%= t(".photo_viewer") %>"
|
||||
class="m-0 h-dvh max-h-none w-screen max-w-none bg-transparent p-0 text-white backdrop:bg-black/90"
|
||||
data-action="click->gallery#backdrop keydown->gallery#keydown touchstart->gallery#touchstart touchend->gallery#touchend">
|
||||
<div class="flex h-full flex-col" data-gallery-close>
|
||||
<div class="flex items-center gap-3 bg-black/60 px-4 py-2 text-sm">
|
||||
<span data-gallery-target="caption" class="min-w-0 flex-1 truncate font-medium"></span>
|
||||
<span data-gallery-target="counter" class="text-white/60 tabular-nums"></span>
|
||||
<a data-gallery-target="original" target="_blank" rel="noopener" class="rounded px-2 py-1 hover:bg-white/15">Open</a>
|
||||
<a data-gallery-target="download" download class="rounded bg-white/15 px-3 py-1 font-medium hover:bg-white/25">⬇ Download</a>
|
||||
<button type="button" data-action="gallery#close" class="rounded px-2 py-1 text-lg leading-none hover:bg-white/15" aria-label="Close" autofocus>✕</button>
|
||||
<%= t(".open_2_html") %>
|
||||
<%= t(".download_2_html") %>
|
||||
<button type="button" data-action="gallery#close" class="rounded px-2 py-1 text-lg leading-none hover:bg-white/15" aria-label="<%= t(".close") %>" autofocus>✕</button>
|
||||
</div>
|
||||
<div class="relative flex min-h-0 flex-1 items-center justify-center p-2 sm:p-6" data-gallery-close>
|
||||
<button type="button" data-gallery-target="nav" data-action="gallery#previous" aria-label="Previous photo"
|
||||
<button type="button" data-gallery-target="nav" data-action="gallery#previous" aria-label="<%= t(".previous_photo") %>"
|
||||
class="absolute left-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 px-3 py-2 text-2xl hover:bg-black/70">‹</button>
|
||||
<img data-gallery-target="image" alt="" class="max-h-full max-w-full select-none object-contain shadow-2xl">
|
||||
<button type="button" data-gallery-target="nav" data-action="gallery#next" aria-label="Next photo"
|
||||
<button type="button" data-gallery-target="nav" data-action="gallery#next" aria-label="<%= t(".next_photo") %>"
|
||||
class="absolute right-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 px-3 py-2 text-2xl hover:bg-black/70">›</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<%= form_with model: [aircraft, squawk], multipart: true, class: "card card-body space-y-4 max-w-2xl" do |f| %>
|
||||
<%= f.errors_summary %>
|
||||
<%= f.field :priority, as: :select, collection: Squawk::PRIORITIES.invert, hint: "“Ground Aircraft” makes the aircraft not airworthy until resolved." %>
|
||||
<%= f.field :issue_reported, as: :textarea, label: "Issue", required: true, autofocus: true %>
|
||||
<%= f.field :component_id, as: :select, label: "Component (optional)", collection: component_options(aircraft) %>
|
||||
<%= f.field :attachments, as: :file, multiple: true, label: squawk.attachments.attached? ? "Add photos / files" : "Photos / files",
|
||||
hint: "Select several at once. Images, PDFs or text, up to #{Setting.max_upload_mb} MB each." %>
|
||||
<%= f.field :priority, as: :select, collection: Squawk::PRIORITIES.invert, hint: t(".ground_aircraft_makes_the_aircraft") %>
|
||||
<%= f.field :issue_reported, as: :textarea, label: t(".issue"), required: true, autofocus: true %>
|
||||
<%= f.field :component_id, as: :select, label: t(".component_optional"), collection: component_options(aircraft) %>
|
||||
<%= f.field :attachments, as: :file, multiple: true, label: squawk.attachments.attached? ? t(".add_photos_files") : t(".photos_files"),
|
||||
hint: t(".select_several_at_once_images", max_upload_mb: Setting.max_upload_mb) %>
|
||||
<% if squawk.persisted? && squawk.attachments.attached? %>
|
||||
<div>
|
||||
<p class="label">Remove attached files</p>
|
||||
<p class="label"><%= t(".remove_attached_files") %></p>
|
||||
<% squawk.attachments.each do |file| %>
|
||||
<label class="flex items-center gap-2 text-sm"><%= check_box_tag "remove_attachment_ids[]", file.id, false, id: "remove_attachment_#{file.id}" %> <%= file.filename %></label>
|
||||
<% end %>
|
||||
@@ -15,10 +15,10 @@
|
||||
<% end %>
|
||||
<% if squawk.persisted? %><%= f.field :notes, as: :textarea, rows: 3 %><% end %>
|
||||
<div class="flex gap-2">
|
||||
<%= f.submit squawk.new_record? ? "Report Squawk" : "Save" %>
|
||||
<%= link_to "Cancel", aircraft_squawks_path(aircraft), class: "btn-secondary" %>
|
||||
<%= f.submit squawk.new_record? ? t(".report_squawk") : t(".save") %>
|
||||
<%= link_to t(".cancel"), aircraft_squawks_path(aircraft), class: "btn-secondary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if squawk.persisted? && owner? %>
|
||||
<div class="mt-4"><%= delete_button "Delete squawk", aircraft_squawk_path(aircraft, squawk) %></div>
|
||||
<div class="mt-4"><%= delete_button t(".delete_squawk"), aircraft_squawk_path(aircraft, squawk) %></div>
|
||||
<% end %>
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<thead><tr><th>Priority</th><th>Issue</th><th>Component</th><th>Reported</th><th></th></tr></thead>
|
||||
<thead><tr><th><%= t(".priority") %></th><th><%= t(".issue") %></th><th><%= t(".component") %></th><th><%= t(".reported") %></th><th></th></tr></thead>
|
||||
<tbody>
|
||||
<% squawks.each do |s| %>
|
||||
<tr>
|
||||
@@ -9,18 +9,18 @@
|
||||
<%= s.issue_reported %>
|
||||
<%= render "squawks/attachments", squawk: s %>
|
||||
<% if s.notes.present? %><div class="mt-1 text-xs text-slate-500"><%= s.notes %></div><% end %>
|
||||
<% if s.deferred? %><div class="mt-1 text-xs text-sky-700"><%= s.deferral_action_label %>, <%= fmt_date(s.deferred_at.to_date) %>, determined by <%= s.deferred_by_name %> (<%= Squawk::DEFERRAL_ROLES[s.deferred_by_role]&.downcase %>)</div><% end %>
|
||||
<% if s.deferred? %><div class="mt-1 text-xs text-sky-700"><%= t(".determined_by_html", deferral_action_label: s.deferral_action_label, to_date: (fmt_date(s.deferred_at.to_date)), deferred_by_name: s.deferred_by_name, deferred_by_role: (Squawk::DEFERRAL_ROLES[s.deferred_by_role]&.downcase)) %></div><% end %>
|
||||
</td>
|
||||
<td><%= s.component&.to_s || "—" %></td>
|
||||
<td class="whitespace-nowrap text-xs text-slate-500"><%= fmt_date(s.created_at.to_date) %><br><%= s.reported_by&.display_name %></td>
|
||||
<td class="whitespace-nowrap text-right">
|
||||
<% if owner? %><%= link_to "Resolve", resolution_aircraft_squawk_path(aircraft, s), class: "btn-secondary btn-sm" %><% end %>
|
||||
<% if owner? %><%= link_to t(".resolve"), resolution_aircraft_squawk_path(aircraft, s), class: "btn-secondary btn-sm" %><% end %>
|
||||
<% if s.deferred? %>
|
||||
<% if owner? %><%= button_to "Undo deferral", undefer_aircraft_squawk_path(aircraft, s), method: :patch, class: "btn-secondary btn-sm", form: { class: "inline" } %><% end %>
|
||||
<% if owner? %><%= button_to t(".undo_deferral"), undefer_aircraft_squawk_path(aircraft, s), method: :patch, class: "btn-secondary btn-sm", form: { class: "inline" } %><% end %>
|
||||
<% else %>
|
||||
<%= link_to "Defer", deferral_aircraft_squawk_path(aircraft, s), class: "btn-secondary btn-sm", title: "Defer as inoperative (91.213(d))" %>
|
||||
<%= link_to t(".defer"), deferral_aircraft_squawk_path(aircraft, s), class: "btn-secondary btn-sm", title: t(".defer_as_inoperative_91_213") %>
|
||||
<% end %>
|
||||
<% if owner? %><%= link_to "Edit", edit_aircraft_squawk_path(aircraft, s), class: "btn-secondary btn-sm" %><% end %>
|
||||
<% if owner? %><%= link_to t(".edit"), edit_aircraft_squawk_path(aircraft, s), class: "btn-secondary btn-sm" %><% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<% content_for :title, "Defer inoperative item" %>
|
||||
<% 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">Defer as inoperative (14 CFR 91.213(d))</h2>
|
||||
<p class="mt-1 text-sm text-slate-600">Without a Minimum Equipment List, an aircraft may fly with an inoperative instrument or piece of equipment only if all of the following are true. Deferring stops this squawk grounding the aircraft. It stays open, and shows as inoperative, until it's fixed.</p>
|
||||
<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">Item:</span> <%= @squawk.issue_reported %><%= " · #{@squawk.component}" if @squawk.component %></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">Confirm each one</legend>
|
||||
<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" %>
|
||||
@@ -22,28 +22,28 @@
|
||||
</fieldset>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<div>
|
||||
<%= label_tag :deferral_action, "What was done", class: "label" %>
|
||||
<%= 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">Deactivating or removing it is maintenance, recorded under Part 43 unless the pilot may do it as preventive maintenance.</p>
|
||||
<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, "Determined by", class: "label" %>
|
||||
<%= 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, "As", class: "label" %>
|
||||
<%= 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, "Notes", class: "label" %>
|
||||
<%= text_area_tag :deferral_notes, params[:deferral_notes], rows: 2, class: "input", placeholder: "e.g. breaker pulled and collared; equipment list reviewed" %>
|
||||
<%= 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 "Defer item", class: "btn-primary" %>
|
||||
<%= link_to "Cancel", aircraft_squawks_path(@aircraft), class: "btn-secondary" %>
|
||||
<%= submit_tag t(".defer_item"), class: "btn-primary" %>
|
||||
<%= link_to t(".cancel"), aircraft_squawks_path(@aircraft), class: "btn-secondary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,3 +1,3 @@
|
||||
<% content_for :title, "Edit Squawk" %>
|
||||
<% content_for :title, t(".edit_squawk") %>
|
||||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||||
<%= render "form", aircraft: @aircraft, squawk: @squawk %>
|
||||
@@ -1,31 +1,31 @@
|
||||
<% content_for :title, "#{@aircraft.tail_number} Squawks" %>
|
||||
<% content_for :title, t(".squawks", tail_number: @aircraft.tail_number) %>
|
||||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Open Squawks</h2>
|
||||
<%= link_to "+ Report Squawk", new_aircraft_squawk_path(@aircraft), class: "btn-primary" %>
|
||||
<h2 class="card-title"><%= t(".open_squawks") %></h2>
|
||||
<%= link_to t(".report_squawk"), new_aircraft_squawk_path(@aircraft), class: "btn-primary" %>
|
||||
</div>
|
||||
<% if @active.any? %><%= render "squawks/table", squawks: @active, aircraft: @aircraft %><% else %><%= empty_state "No open squawks." %><% end %>
|
||||
<% if @active.any? %><%= render "squawks/table", squawks: @active, aircraft: @aircraft %><% else %><%= empty_state t(".no_open_squawks") %><% end %>
|
||||
</section>
|
||||
|
||||
<section class="card mt-5">
|
||||
<div class="card-header"><h2 class="card-title">Resolved</h2></div>
|
||||
<div class="card-header"><h2 class="card-title"><%= t(".resolved") %></h2></div>
|
||||
<% if @resolved.any? %>
|
||||
<table class="table">
|
||||
<thead><tr><th>Priority</th><th>Issue</th><th>Resolution</th><th>Resolved</th><th></th></tr></thead>
|
||||
<thead><tr><th><%= t(".priority") %></th><th><%= t(".issue") %></th><th><%= t(".resolution") %></th><th><%= t(".resolved") %></th><th></th></tr></thead>
|
||||
<tbody>
|
||||
<% @resolved.each do |s| %>
|
||||
<tr>
|
||||
<td><%= squawk_priority_badge(s) %></td>
|
||||
<td><%= s.issue_reported %><%= render "squawks/attachments", squawk: s %></td>
|
||||
<td class="text-xs text-slate-600"><%= s.notes %><% if s.logbook_entry %><div><%= link_to "Logbook #{fmt_date(s.logbook_entry.date)}", aircraft_logbook_entry_path(@aircraft, s.logbook_entry), class: "link" %></div><% end %></td>
|
||||
<td class="text-xs text-slate-600"><%= s.notes %><% if s.logbook_entry %><div><%= link_to t(".logbook", date: fmt_date(s.logbook_entry.date)), aircraft_logbook_entry_path(@aircraft, s.logbook_entry), class: "link" %></div><% end %></td>
|
||||
<td class="text-xs text-slate-500"><%= fmt_date(s.resolved_at&.to_date) %></td>
|
||||
<td class="text-right"><% if owner? %><%= button_to "Reopen", reopen_aircraft_squawk_path(@aircraft, s), method: :patch, class: "btn-secondary btn-sm" %><% end %></td>
|
||||
<td class="text-right"><% if owner? %><%= button_to t(".reopen"), reopen_aircraft_squawk_path(@aircraft, s), method: :patch, class: "btn-secondary btn-sm" %><% end %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<%= empty_state "No resolved squawks." %>
|
||||
<%= empty_state t(".no_resolved_squawks") %>
|
||||
<% end %>
|
||||
</section>
|
||||
@@ -1,3 +1,3 @@
|
||||
<% content_for :title, "Report Squawk" %>
|
||||
<% content_for :title, t(".report_squawk") %>
|
||||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||||
<%= render "form", aircraft: @aircraft, squawk: @squawk %>
|
||||
@@ -1,8 +1,8 @@
|
||||
<% content_for :title, "Resolve squawk" %>
|
||||
<% content_for :title, t(".resolve_squawk") %>
|
||||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||||
<%= form_with url: resolve_aircraft_squawk_path(@aircraft, @squawk), method: :patch, class: "card card-body max-w-3xl space-y-4" do %>
|
||||
<div>
|
||||
<h2 class="card-title">Resolve squawk</h2>
|
||||
<h2 class="card-title"><%= t(".resolve_squawk") %></h2>
|
||||
<p class="mt-1 rounded-md bg-slate-50 p-3 text-sm"><%= @squawk.issue_reported %><%= " · #{@squawk.component}" if @squawk.component %></p>
|
||||
</div>
|
||||
<% if @entry.errors.any? %>
|
||||
@@ -12,39 +12,39 @@
|
||||
<% end %>
|
||||
<% choice = params[:logbook].presence || "new" %>
|
||||
<fieldset class="space-y-2 text-sm">
|
||||
<legend class="label">Logbook</legend>
|
||||
<label class="flex items-center gap-2"><%= radio_button_tag :logbook, "new", choice == "new" %> Record the fix as a new logbook entry</label>
|
||||
<label class="flex items-center gap-2"><%= radio_button_tag :logbook, "existing", choice == "existing" %> Link an existing entry:
|
||||
<legend class="label"><%= t(".logbook") %></legend>
|
||||
<label class="flex items-center gap-2"><%= t(".record_the_fix_as_a_html", radio: (radio_button_tag :logbook, "new", choice == "new")) %></label>
|
||||
<label class="flex items-center gap-2"><%= t(".link_an_existing_entry_html", existing: (radio_button_tag :logbook, "existing", choice == "existing")) %>
|
||||
<%= select_tag :logbook_entry_id, options_for_select(logbook_options(@aircraft).reject { _2.nil? }, params[:logbook_entry_id]), class: "input w-auto" %></label>
|
||||
<label class="flex items-center gap-2"><%= radio_button_tag :logbook, "none", choice == "none" %> No logbook entry (e.g. it wasn't a defect)</label>
|
||||
<label class="flex items-center gap-2"><%= t(".no_logbook_entry_e_g_html", none: (radio_button_tag :logbook, "none", choice == "none")) %></label>
|
||||
</fieldset>
|
||||
|
||||
<div class="space-y-4 rounded-md border border-slate-200 p-3" data-controller="signer component-times"
|
||||
data-component-times-aircraft-hours-value="<%= @aircraft.current_hours.to_f %>">
|
||||
<p class="text-xs text-slate-500">For a new entry. 14 CFR 43.9: what was done, the date, and the name, certificate number and kind of certificate of whoever approved the return to service.</p>
|
||||
<p class="text-xs text-slate-500"><%= t(".for_a_new_entry_14") %></p>
|
||||
<%= render "shared/sign_as" %>
|
||||
<%= fields_for :logbook_entry, @entry do |f| %>
|
||||
<div class="grid gap-4 sm:grid-cols-3">
|
||||
<%= f.field :date, as: :date %>
|
||||
<%= f.field :log_type, as: :select, label: "Logbook", collection: LogbookEntry::LOG_TYPES.invert,
|
||||
<%= f.field :log_type, as: :select, label: t(".logbook"), collection: LogbookEntry::LOG_TYPES.invert,
|
||||
data: { component_times_target: "logType", action: "component-times#logTypeChanged" } %>
|
||||
<%= f.field :aircraft_hours_at_entry, as: :number, step: 0.1, label: "Airframe total time",
|
||||
<%= f.field :aircraft_hours_at_entry, as: :number, step: 0.1, label: t(".airframe_total_time"),
|
||||
data: { component_times_target: "airframe", action: "input->component-times#airframeChanged" } %>
|
||||
</div>
|
||||
<%= render "logbook_entries/component_fields", f: f, aircraft: @aircraft %>
|
||||
<%= f.field :text, as: :textarea, label: "Work performed", rows: 3 %>
|
||||
<%= f.field :text, as: :textarea, label: t(".work_performed"), rows: 3 %>
|
||||
<div class="grid gap-4 sm:grid-cols-3">
|
||||
<%= f.field :signoff_person, label: "Signed off by", data: { signer_target: "name" } %>
|
||||
<%= f.field :signoff_certificate_type, as: :select, label: "Kind of certificate", include_blank: "—", collection: LogbookEntry::CERTIFICATE_TYPES.invert,
|
||||
<%= f.field :signoff_person, label: t(".signed_off_by"), data: { signer_target: "name" } %>
|
||||
<%= f.field :signoff_certificate_type, as: :select, label: t(".kind_of_certificate"), include_blank: "—", collection: LogbookEntry::CERTIFICATE_TYPES.invert,
|
||||
data: { signer_target: "kind" } %>
|
||||
<%= f.field :signoff_certificate_number, label: "Certificate number", data: { signer_target: "number" } %>
|
||||
<%= f.field :signoff_certificate_number, label: t(".certificate_number"), data: { signer_target: "number" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= label_tag :resolution_notes, "Resolution notes (optional)", class: "label" %>
|
||||
<%= label_tag :resolution_notes, t(".resolution_notes_optional"), class: "label" %>
|
||||
<%= text_area_tag :resolution_notes, params[:resolution_notes], rows: 2, class: "input" %>
|
||||
</div>
|
||||
<div class="flex gap-2"><%= submit_tag "Resolve", class: "btn-primary" %><%= link_to "Cancel", aircraft_squawks_path(@aircraft), class: "btn-secondary" %></div>
|
||||
<div class="flex gap-2"><%= submit_tag t(".resolve"), class: "btn-primary" %><%= link_to t(".cancel"), aircraft_squawks_path(@aircraft), class: "btn-secondary" %></div>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user