Consistency and accessibility: one date/time format, lang, skip link, focus outlines, alt text, labelled icons, contrast; release notes updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-11 21:17:26 -05:00
1 parent 191eb030e8
commit 215efe6814
56 files changed
+146 -97

No files matched your search

+8 -2
View File
@@ -26,6 +26,7 @@ The first numbered release. Highlights of what Simple Aircraft Manager does as o
### Flying
- Flight log grouped by day with the route and totals; long logs load as you scroll.
- Log flights with no signal: the phone keeps them and sends them when it's back online.
- Engine monitor data charts, GPS tracks, AirTrail sync, spreadsheet import, and oil and fuel trends.
### Accounts and security
@@ -33,6 +34,11 @@ The first numbered release. Highlights of what Simple Aircraft Manager does as o
- Single sign-on (OpenID Connect), sign-in links, account lockout, breached-password check and optional authenticator codes.
- Command-line account recovery and maintenance commands (health report, records check, restore).
### Help
### Finding things
- A user guide for every area, in the app under Help.
- One search box for the logbook, squawks, notes, ADs, documents (including the text of scanned pages), components, flights and major records.
### Help and polish
- A user guide for every area, in the app under Help; release notes (this page) under What's new.
- Dates read the same way everywhere ("Nov 8, 2026"); keyboard users get a skip link and visible focus; images have descriptions.
+7
View File
@@ -131,6 +131,13 @@
.markdown th, .markdown td { border: 1px solid var(--color-slate-200); padding: 0.25rem 0.5rem; text-align: left; }
.markdown th { background: var(--color-slate-50); font-weight: 600; }
.markdown.guide { line-height: 1.6; }
/* Keyboard users: a visible focus ring everywhere, and a way past the menus. */
:where(a, button, summary, select, [tabindex]:not([tabindex="-1"]), input[type=checkbox], input[type=radio]):focus-visible {
outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 0.25rem;
}
.skip-link { position: absolute; left: 0.5rem; top: -3rem; z-index: 50; background: var(--color-surface); color: var(--color-accent);
padding: 0.5rem 0.75rem; border-radius: 0.375rem; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); }
.skip-link:focus { top: 0.5rem; }
.markdown.guide h1 { font-size: 1.5rem; font-weight: 700; }
.markdown.guide h2 { font-size: 1.15rem; margin-top: 1.25em; }
.markdown.guide h3 { margin-top: 1em; }
+7 -1
View File
@@ -4,8 +4,14 @@ module ApplicationHelper
number_with_precision(value, precision: 1, delimiter: ",")
end
# How dates and times read across the app: "Nov 8, 2026", "Nov 8, 2026 14:05".
# (Signatures and the record history keep exact UTC timestamps, 2026-11-08 14:05 UTC.)
def fmt_date(value)
value ? l(value.to_date, format: :long) : "—"
value ? value.to_date.strftime("%b %-d, %Y") : "—"
end
def fmt_time(value)
value ? value.in_time_zone.strftime("%b %-d, %Y %H:%M") : "—"
end
AIRWORTHINESS_COLORS = { "RED" => "red", "LIMITED" => "blue", "ORANGE" => "orange", "GREEN" => "green", "INFO" => "gray" }.freeze
+1
View File
@@ -1,4 +1,5 @@
class ApplicationMailer < ActionMailer::Base
helper ApplicationHelper # fmt_date etc. in emails
default from: ENV.fetch("MAIL_FROM", "aircraft-manager@localhost")
layout "mailer"
end
+1 -1
View File
@@ -34,7 +34,7 @@
<%= r.subject %>
<% if r.summary %><details class="mt-1 text-xs text-slate-600"><summary class="cursor-pointer text-sky-700">Summary</summary><%= r.summary %></details><% end %>
</td>
<td class="whitespace-nowrap text-xs"><%= r.effective_date %></td>
<td class="whitespace-nowrap text-xs"><%= fmt_date(r.effective_date) %></td>
<td class="text-xs">
<% r.notes.each do |n| %><div class="<%= n.start_with?("Already", "Matches") ? 'text-slate-500' : 'text-amber-800' %>">• <%= n %></div><% end %>
</td>
+7 -7
View File
@@ -14,8 +14,8 @@
<p class="mt-1 flex flex-wrap gap-x-3 text-sm"><%= link_to "What's new", help_page_path("changelog"), class: "link" %><% if info.repository_url %><%= link_to "Source code", info.repository_url, class: "link", target: "_blank", rel: "noopener" %><% end %></p>
</div>
<dl class="grid grid-cols-2 gap-x-6 gap-y-1 text-sm sm:grid-cols-3">
<div><dt class="text-slate-500">Built</dt><dd class="font-medium"><%= info.built_at ? l(info.built_at.in_time_zone, format: :short) : "—" %></dd></div>
<div><dt class="text-slate-500">Started</dt><dd class="font-medium"><%= l(info.booted_at.in_time_zone, format: :short) %></dd></div>
<div><dt class="text-slate-500">Built</dt><dd class="font-medium"><%= info.built_at ? fmt_time(info.built_at.in_time_zone) : "—" %></dd></div>
<div><dt class="text-slate-500">Started</dt><dd class="font-medium"><%= fmt_time(info.booted_at.in_time_zone) %></dd></div>
<div><dt class="text-slate-500">Uptime</dt><dd class="font-medium"><%= distance_of_time_in_words(info.booted_at, Time.current) %></dd></div>
</dl>
</div>
@@ -89,13 +89,13 @@
<% check = IntegrityCheck.latest %>
<% backup = BackupRun.latest %>
<%= render "pairs", pairs: [
[ "Last check", check ? "#{l(check.created_at, format: :short)} · #{check.ok ? 'no problems' : pluralize(check.problems.size, 'problem')}" : "not run yet" ],
[ "Last check", check ? "#{fmt_time(check.created_at)} · #{check.ok ? 'no problems' : pluralize(check.problems.size, 'problem')}" : "not run yet" ],
[ "Checked", check ? "#{number_with_delimiter(check.versions_checked)} history entries, #{number_with_delimiter(check.signatures_checked)} signatures" : nil ],
[ "Last backup", backup ? "#{l(backup.created_at, format: :short)} · #{backup.ok ? number_to_human_size(backup.bytes) : 'FAILED'}" : "not run yet" ],
[ "Last backup", backup ? "#{fmt_time(backup.created_at)} · #{backup.ok ? number_to_human_size(backup.bytes) : 'FAILED'}" : "not run yet" ],
[ "Backup check", backup&.message ],
[ "Backups kept", "#{Setting.integer('backups_kept')} (in storage/backups)" ],
[ "Off-site backup", OffsiteConnection.connected? ? ((o = OffsiteRun.latest_backup) ? tag.span("#{o.ok ? 'OK' : 'FAILED'} #{o.created_at.to_date}", class: (o.ok && o.recent? ? nil : "badge-orange")) + " · Google Drive (#{OffsiteConnection.current.account_email})" : "Google Drive connected, none yet") : link_to("not set up", admin_offsite_backup_path, class: "badge-orange") ],
[ "Procedures", (r = ProceduresRevision.current) ? "Revision #{r.number}, adopted #{r.adopted_at.to_date}" : tag.span("not adopted", class: "badge-orange") ],
[ "Off-site backup", OffsiteConnection.connected? ? ((o = OffsiteRun.latest_backup) ? tag.span("#{o.ok ? 'OK' : 'FAILED'} #{fmt_date(o.created_at.to_date)}", class: (o.ok && o.recent? ? nil : "badge-orange")) + " · Google Drive (#{OffsiteConnection.current.account_email})" : "Google Drive connected, none yet") : link_to("not set up", admin_offsite_backup_path, class: "badge-orange") ],
[ "Procedures", (r = ProceduresRevision.current) ? "Revision #{r.number}, adopted #{fmt_date(r.adopted_at.to_date)}" : tag.span("not adopted", class: "badge-orange") ],
[ "Last audit", AuditRun.latest ? "#{AuditRun.latest.performed_at.to_date} · #{AuditRun.latest.passed ? 'passed' : 'items not passed'}" : "none yet" ],
[ "Next audit due", AuditRun.due_soon? ? tag.span(AuditRun.next_due.to_s, class: "badge-orange") : AuditRun.next_due.to_s ]
] %>
@@ -108,7 +108,7 @@
<div class="card-header"><h2 class="card-title">Software versions</h2></div>
<% revisions = AppRevision.latest_first.limit(20) %>
<% if revisions.any? %>
<%= render "pairs", pairs: revisions.map { |r| [ [ r.version, "build #{r.revision}" ].compact.join(" · "), "#{l(r.first_seen_at, format: :short)} – #{l(r.last_seen_at, format: :short)}" ] } %>
<%= render "pairs", pairs: revisions.map { |r| [ [ r.version, "build #{r.revision}" ].compact.join(" · "), "#{fmt_time(r.first_seen_at)} – #{fmt_time(r.last_seen_at)}" ] } %>
<% else %>
<%= empty_state "No versions recorded yet." %>
<% end %>
+1 -1
View File
@@ -31,7 +31,7 @@
<tbody>
<% @updates.each do |u| %>
<tr>
<td class="whitespace-nowrap text-xs"><%= l(u.created_at, format: :short) %></td>
<td class="whitespace-nowrap text-xs"><%= fmt_time(u.created_at) %></td>
<td class="text-xs"><%= u.requested_by&.display_name || "Startup" %></td>
<td><%= tag.span u.status.capitalize, class: { "done" => "badge-green", "failed" => "badge-red" }.fetch(u.status, "badge-blue") %></td>
<td class="text-xs"><%= u.done? ? u.summary : u.error %></td>
+2 -2
View File
@@ -21,13 +21,13 @@
<label class="flex items-start gap-2 text-sm font-medium"><%= check_box_tag "answers[#{key}][passed]", "1", false, class: "mt-0.5 h-4 w-4 shrink-0 rounded border-slate-300" %><span><%= title %></span></label>
<% if key == "restore_test" && OffsiteConnection.connected? %>
<p class="ml-6 text-xs text-slate-600">
<% if (rt = @audit.restore_test) %>Last automatic restore test (<%= rt.created_at.to_date %>): <span class="<%= rt.ok ? 'badge-green' : 'badge-red' %>"><%= rt.ok ? "OK" : "Failed" %></span> <%= rt.message %><% else %>No automatic restore test yet.<% end %>
<% if (rt = @audit.restore_test) %>Last automatic restore test (<%= fmt_date(rt.created_at.to_date) %>): <span class="<%= rt.ok ? 'badge-green' : 'badge-red' %>"><%= rt.ok ? "OK" : "Failed" %></span> <%= rt.message %><% else %>No automatic restore test yet.<% end %>
<%= link_to "Run one", admin_offsite_backup_path, class: "link", target: "_blank" %> (Admin → Off-site Backup → Test restore), then also open a copy downloaded from Google Drive yourself.
</p>
<% end %>
<% if key == "sample" %>
<ul class="ml-6 list-disc text-xs text-slate-600">
<% sample.each do |e| %><li><%= hidden_field_tag "sample_ids[]", e.id, id: nil %><%= link_to "#{e.aircraft.tail_number} · #{e.date} · #{e.text.truncate(80)}", aircraft_logbook_entry_path(e.aircraft, e), class: "link", target: "_blank" %><%= " (signed)" if e.signature %></li><% end %>
<% sample.each do |e| %><li><%= hidden_field_tag "sample_ids[]", e.id, id: nil %><%= link_to "#{e.aircraft.tail_number} · #{fmt_date(e.date)} · #{e.text.truncate(80)}", aircraft_logbook_entry_path(e.aircraft, e), class: "link", target: "_blank" %><%= " (signed)" if e.signature %></li><% end %>
<% if sample.empty? %><li>No entries since the last audit.</li><% end %>
</ul>
<% elsif key == "users" %>
+2 -2
View File
@@ -1,11 +1,11 @@
<% content_for :title, "Records audit" %>
<h1 class="mb-1 text-2xl font-bold">Records audit, <%= @audit.performed_at.to_date %></h1>
<h1 class="mb-1 text-2xl font-bold">Records audit, <%= fmt_date(@audit.performed_at.to_date) %></h1>
<p class="mb-4 text-sm text-slate-600">By <%= @audit.performed_by&.display_name %> · <span class="<%= @audit.passed ? 'badge-green' : 'badge-orange' %>"><%= @audit.passed ? "Passed" : "Items not passed" %></span></p>
<section class="card">
<ul class="divide-y divide-slate-100 text-sm">
<% @audit.results.each do |r| %>
<li class="flex items-start gap-3 px-4 py-2"><span class="<%= r['passed'] ? 'badge-green' : 'badge-red' %>"><%= r["passed"] ? "Pass" : "Fail" %></span>
<span><span class="font-medium"><%= r["title"] %></span><%= tag.span(" (checked by the app)", class: "text-xs text-slate-400") if r["auto"] %>
<span><span class="font-medium"><%= r["title"] %></span><%= tag.span(" (checked by the app)", class: "text-xs text-slate-500") if r["auto"] %>
<% if r["detail"].present? %><span class="block text-xs text-slate-600"><%= r["detail"] %></span><% end %></span></li>
<% end %>
</ul>
@@ -6,7 +6,7 @@
<section class="card card-body space-y-3">
<h2 class="card-title">Google Drive</h2>
<% if @connection.connected? %>
<p class="text-sm"><span class="badge-green">Connected</span> <strong><%= @connection.account_email %></strong>, by <%= @connection.connected_by&.display_name %> on <%= @connection.connected_at&.to_date %>.
<p class="text-sm"><span class="badge-green">Connected</span> <strong><%= @connection.account_email %></strong>, by <%= @connection.connected_by&.display_name %> on <%= fmt_date(@connection.connected_at&.to_date) %>.
Folder: <em><%= OffsiteConnection::ROOT_FOLDER %></em>.</p>
<p class="text-sm">Uploaded files copied: <%= @files_copied %> of <%= @files_total %>.</p>
<div class="flex flex-wrap gap-2">
@@ -52,7 +52,7 @@
<ul class="divide-y divide-slate-100 text-sm">
<% @runs.each do |r| %>
<li class="flex items-start gap-3 px-4 py-2"><span class="<%= r.ok ? 'badge-green' : 'badge-red' %>"><%= r.ok ? "OK" : "Failed" %></span>
<span><span class="font-medium"><%= r.kind == "restore_test" ? "Restore test" : "Backup" %></span> · <%= l(r.created_at.in_time_zone, format: :short) %><span class="block text-xs text-slate-600"><%= r.message %></span></span></li>
<span><span class="font-medium"><%= r.kind == "restore_test" ? "Restore test" : "Backup" %></span> · <%= fmt_time(r.created_at.in_time_zone) %><span class="block text-xs text-slate-600"><%= r.message %></span></span></li>
<% end %>
</ul>
<% else %><%= empty_state "None yet." %><% end %>
@@ -110,7 +110,7 @@
<table class="mt-2 w-full text-sm">
<thead><tr class="border-b border-slate-300 text-left text-xs uppercase text-slate-500"><th class="py-1">Revision</th><th>Adopted</th><th>By</th><th>Summary</th></tr></thead>
<tbody>
<% revisions.each do |r| %><tr class="border-b border-slate-100"><td class="py-1"><%= r.number %></td><td><%= r.adopted_at.to_date %></td><td><%= r.adopted_by&.display_name %></td><td><%= r.summary %></td></tr><% end %>
<% revisions.each do |r| %><tr class="border-b border-slate-100"><td class="py-1"><%= r.number %></td><td><%= fmt_date(r.adopted_at.to_date) %></td><td><%= r.adopted_by&.display_name %></td><td><%= r.summary %></td></tr><% end %>
<tr><td class="py-1"><%= number %></td><td><%= adopted_at&.to_date || "—" %></td><td><%= adopted_by&.display_name %></td><td><%= summary.presence || "This revision" %></td></tr>
</tbody>
</table>
+2 -2
View File
@@ -38,7 +38,7 @@
<h2 class="card-title">Current revision</h2>
<% current = @revisions.first %>
<% if current %>
<p class="text-sm">Revision <strong><%= current.number %></strong>, adopted <%= current.adopted_at.to_date %> by <%= current.adopted_by&.display_name %>. <%= link_to "View / print", revision_admin_procedures_path(current), class: "link", target: "_blank" %></p>
<p class="text-sm">Revision <strong><%= current.number %></strong>, adopted <%= fmt_date(current.adopted_at.to_date) %> by <%= current.adopted_by&.display_name %>. <%= link_to "View / print", revision_admin_procedures_path(current), class: "link", target: "_blank" %></p>
<% else %>
<p class="text-sm text-amber-800">No revision adopted yet.</p>
<% end %>
@@ -54,7 +54,7 @@
<div class="card-header"><h2 class="card-title">Earlier revisions</h2></div>
<% if @revisions.size > 1 %>
<ul class="divide-y divide-slate-100 text-sm">
<% @revisions.drop(1).each do |r| %><li class="flex justify-between px-4 py-2"><span>Revision <%= r.number %> · <%= r.adopted_at.to_date %> · <%= r.summary %></span><%= link_to "View", revision_admin_procedures_path(r), class: "link", target: "_blank" %></li><% end %>
<% @revisions.drop(1).each do |r| %><li class="flex justify-between px-4 py-2"><span>Revision <%= r.number %> · <%= fmt_date(r.adopted_at.to_date) %> · <%= r.summary %></span><%= link_to "View", revision_admin_procedures_path(r), class: "link", target: "_blank" %></li><% end %>
</ul>
<% else %><%= empty_state "None." %><% end %>
</section>
+2 -2
View File
@@ -19,9 +19,9 @@
<%= link_to aircraft_path(aircraft), class: "card block overflow-hidden transition hover:shadow-md" do %>
<div class="flex h-36 items-center justify-center bg-slate-200">
<% if aircraft.picture.attached? %>
<%= image_tag aircraft.picture, class: "h-full w-full object-cover" %>
<%= image_tag aircraft.picture, class: "h-full w-full object-cover", alt: "Photo of #{aircraft.tail_number}" %>
<% else %>
<span class="text-5xl text-slate-400">✈</span>
<span class="text-5xl text-slate-400" aria-hidden="true">✈</span>
<% end %>
</div>
<div class="card-body">
+1 -1
View File
@@ -41,7 +41,7 @@
<%= delete_button "Revoke", aircraft_share_token_path(@aircraft, t), confirm: "Revoke this link? Anyone using it will lose access." %>
</div>
<input type="text" readonly value="<%= shared_url(t.token) %>" class="input mt-2 font-mono text-xs" data-select-on-click>
<div class="mt-1 text-xs text-slate-500">Created <%= t.created_at.to_date %><%= " by #{t.created_by.display_name}" if t.created_by %> · <%= t.expires_at ? "expires #{l t.expires_at, format: :short}" : "never expires" %></div>
<div class="mt-1 text-xs text-slate-500">Created <%= fmt_date(t.created_at.to_date) %><%= " by #{t.created_by.display_name}" if t.created_by %> · <%= t.expires_at ? "expires #{l t.expires_at, format: :short}" : "never expires" %></div>
</li>
<% end %>
</ul>
@@ -24,10 +24,10 @@
<% @rows.each do |row| ad = row.ad %>
<tr>
<td class="whitespace-nowrap font-medium"><span class="badge-gray mr-1"><%= ad.bulletin_label %></span><%= ad_link(ad) %>
<% if ad.document %><%= link_to "📄", aircraft_document_path(@aircraft, ad.document), title: ad.document.name %><% end %>
<% unless ad.mandatory? %><div class="text-xs text-slate-400">not mandatory</div><% end %></td>
<% if ad.document %><%= link_to "📄", aircraft_document_path(@aircraft, ad.document), title: ad.document.name, "aria-label": "Document: #{ad.document.name}" %><% end %>
<% unless ad.mandatory? %><div class="text-xs text-slate-500">not mandatory</div><% end %></td>
<td class="max-w-sm text-xs"><%= ad.short_description %>
<% if ad.effective_date || ad.product_type.present? %><div class="text-slate-500"><%= [(ad.effective_date && "Effective #{ad.effective_date}"), ad.product_type.presence].compact.join(" · ") %></div><% end %>
<% if ad.effective_date || ad.product_type.present? %><div class="text-slate-500"><%= [(ad.effective_date && "Effective #{fmt_date(ad.effective_date)}"), ad.product_type.presence].compact.join(" · ") %></div><% end %>
<% if ad.superseded_by.present? %><div class="text-amber-700">Superseded by <%= ad.superseded_by %></div><% end %>
<% if ad.conditional? && ad.trigger_condition.present? %><div class="text-slate-500">Trigger: <%= ad.trigger_condition %></div><% end %></td>
<td class="text-xs"><%= ad.recurring? ? [ad.recurring_hours.to_f > 0 && "#{hours(ad.recurring_hours)} h", ad.recurring_months > 0 && "#{ad.recurring_months} mo"].select(&:itself).join(" / ") : "One-time" %></td>
@@ -63,7 +63,7 @@
</div>
<div class="card-body space-y-2 text-sm">
<% if last_drs %>
<p>Last import <strong><%= last_drs.created_at.to_date %></strong> by <%= last_drs.user&.display_name || "—" %>: <%= last_drs.ad_count %> ADs<%= ", covering #{Array(last_drs.models_covered).to_sentence}" if Array(last_drs.models_covered).any? %>.</p>
<p>Last import <strong><%= fmt_date(last_drs.created_at.to_date) %></strong> by <%= last_drs.user&.display_name || "—" %>: <%= last_drs.ad_count %> ADs<%= ", covering #{Array(last_drs.models_covered).to_sentence}" if Array(last_drs.models_covered).any? %>.</p>
<% if last_drs.created_at < DrsImport::RENEW_AFTER.ago %><p class="text-amber-800">Over a year old: import again to pick up revised ADs and anything the weekly search missed.</p><% end %>
<% else %>
<p class="text-amber-800">No DRS import yet. Export the ADs for each model from drs.faa.gov and import them here.</p>
@@ -86,7 +86,7 @@
<li class="flex flex-wrap items-start justify-between gap-3 px-4 py-3">
<div class="min-w-0 flex-1 text-sm">
<div class="font-medium"><%= alert.ad_number ? "AD #{alert.ad_number}" : alert.fr_document_number %> · <%= alert.title.to_s.delete_prefix("Airworthiness Directives; ") %></div>
<div class="text-xs text-slate-500"><%= [ (alert.effective_on && "Effective #{alert.effective_on}"), "published #{alert.publication_date}", "matched “#{alert.matched_term}”" ].compact.join(" · ") %></div>
<div class="text-xs text-slate-500"><%= [ (alert.effective_on && "Effective #{fmt_date(alert.effective_on)}"), "published #{fmt_date(alert.publication_date)}", "matched “#{alert.matched_term}”" ].compact.join(" · ") %></div>
<p class="mt-1 text-xs text-slate-600"><%= alert.abstract.to_s.truncate(400) %></p>
<%= link_to "Read it in the Federal Register", alert.html_url, class: "link text-xs", target: "_blank", rel: "noopener" %>
</div>
@@ -122,11 +122,11 @@
<tbody>
<% @history.each do |c| %>
<tr>
<td class="whitespace-nowrap"><%= c.date_complied %></td>
<td class="whitespace-nowrap"><%= fmt_date(c.date_complied) %></td>
<% ad = c.airworthiness_directive %>
<td class="max-w-xs">
<span class="whitespace-nowrap font-medium"><%= ad_link(ad) %></span>
<% if ad.document %><%= link_to "📄", aircraft_document_path(@aircraft, ad.document), title: ad.document.name %><% end %>
<% if ad.document %><%= link_to "📄", aircraft_document_path(@aircraft, ad.document), title: ad.document.name, "aria-label": "Document: #{ad.document.name}" %><% end %>
<div class="text-xs text-slate-500"><%= ad.short_description %><%= " · #{c.component}" if c.component %></div>
</td>
<td class="text-right"><%= hours(c.aircraft_hours_at_compliance) %></td>
@@ -136,8 +136,8 @@
<%= c.compliance_notes %>
<% if c.logbook_entry || c.inspection_record %>
<div class="mt-1 flex flex-wrap gap-x-3">
<% if c.logbook_entry %><%= link_to "Logbook #{c.logbook_entry.date}", aircraft_logbook_entry_path(@aircraft, c.logbook_entry), class: "link" %><% end %>
<% if c.inspection_record %><%= link_to "#{c.inspection_record.inspection_type.name} #{c.inspection_record.date}", aircraft_inspections_path(@aircraft), class: "link" %><% end %>
<% if c.logbook_entry %><%= link_to "Logbook #{fmt_date(c.logbook_entry.date)}", aircraft_logbook_entry_path(@aircraft, c.logbook_entry), class: "link" %><% end %>
<% if c.inspection_record %><%= link_to "#{c.inspection_record.inspection_type.name} #{fmt_date(c.inspection_record.date)}", aircraft_inspections_path(@aircraft), class: "link" %><% end %>
</div>
<% end %>
</td>
+1 -1
View File
@@ -35,7 +35,7 @@
Replace: <%= [c.replacement_hours && "#{c.replacement_hours} h", c.replacement_days && "#{c.replacement_days} d"].compact.join(" / ") %><br>
<% end %>
<% if c.tbo_critical? && c.tbo_hours %>TBO: <%= c.tbo_hours %> h<%= " (on condition)" if c.on_condition? %><br><% end %>
<% if c.expires_on %>Expires: <%= c.expires_on %><% end %>
<% if c.expires_on %>Expires: <%= fmt_date(c.expires_on) %><% end %>
</td>
<td><%= life_badge(c.life_status) %></td>
<td class="whitespace-nowrap text-right">
@@ -13,7 +13,7 @@
<tbody>
<% records.each do |r| %>
<tr class="consumable-record">
<td class="whitespace-nowrap"><%= r.date %></td>
<td class="whitespace-nowrap"><%= fmt_date(r.date) %></td>
<td><%= tag.span ConsumableRecord::TYPES[r.record_type], class: r.record_type == "oil" ? "badge-orange" : "badge-blue" %></td>
<td class="text-right tabular-nums" data-label="Added"><%= r.quantity_added %> <%= r.unit %></td>
<td class="text-right tabular-nums" data-label="Level after"><%= r.level_after ? "#{r.level_after} #{r.unit}" : "" %></td>
+1 -1
View File
@@ -3,7 +3,7 @@
<%= link_to doc.name, aircraft_document_path(aircraft, doc), class: "link font-medium" %>
<span class="ml-2 text-xs text-slate-500"><%= doc.type_label %> · <%= pluralize(doc.pages.size, "file") %></span>
<% if doc.legacy_record? %><span class="ml-1 badge-gray" title="Scan of the paper (legacy) records">Legacy record</span><% end %>
<% if doc.expires_on %><span class="ml-1 <%= doc.expired? ? 'badge-red' : (Date.current + doc.expiry_warning_days >= doc.expires_on ? 'badge-orange' : 'badge-gray') %>"><%= doc.expired? ? "Expired" : "Expires" %> <%= doc.expires_on %></span><% end %>
<% if doc.expires_on %><span class="ml-1 <%= doc.expired? ? 'badge-red' : (Date.current + doc.expiry_warning_days >= doc.expires_on ? 'badge-orange' : 'badge-gray') %>"><%= doc.expired? ? "Expired" : "Expires" %> <%= fmt_date(doc.expires_on) %></span><% end %>
<% if doc.description.present? %><div class="text-xs text-slate-500"><%= doc.description.truncate(120) %></div><% end %>
</div>
<div class="flex items-center gap-2">
+1 -1
View File
@@ -11,7 +11,7 @@
</div>
<div class="flex justify-center rounded bg-slate-50 p-2">
<% if current.image? %>
<%= image_tag rails_blob_path(current, disposition: :inline), class: "max-h-[80vh] max-w-full" %>
<%= image_tag rails_blob_path(current, disposition: :inline), alt: current.filename.to_s, class: "max-h-[80vh] max-w-full" %>
<% elsif current.content_type == "application/pdf" %>
<iframe src="<%= rails_blob_path(current, disposition: :inline) %>" class="h-[80vh] w-full"></iframe>
<% else %>
+1 -1
View File
@@ -71,7 +71,7 @@
<tbody>
<% rows.each do |r| %>
<tr class="<%= 'opacity-50' unless r.importable? %>">
<td><%= r.line %></td><td class="whitespace-nowrap"><%= r.date %></td><td><%= r.from %></td><td><%= r.to %></td>
<td><%= r.line %></td><td class="whitespace-nowrap"><%= fmt_date(r.date) %></td><td><%= r.from %></td><td><%= r.to %></td>
<td class="text-right tabular-nums"><%= r.tach_in %></td><td class="text-right tabular-nums"><%= hours(r.tach_time) if r.tach_time %></td>
<td class="text-right tabular-nums"><%= r.hobbs_in %></td><td class="text-right tabular-nums"><%= hours(r.hobbs_time) if r.hobbs_time %></td>
<td class="text-right"><%= r.oil %></td><td class="text-right"><%= r.fuel %></td>
+4 -4
View File
@@ -10,8 +10,8 @@
<span class="font-medium whitespace-nowrap"><%= day.date.strftime("%a %b %-d, %Y") %><span class="block text-xs font-normal text-slate-500"><%= pluralize(day.flights.size, "flight") %></span></span>
<span class="min-w-0 basis-full sm:basis-auto">
<%= day.route.presence || blank %>
<% if day.track_log? %><span class="ml-1" title="GPS track attached" aria-label="GPS track attached">📍</span><% end %>
<% if day.engine_data? %><span class="ml-1" title="Engine data attached" aria-label="Engine data attached">📈</span><% end %>
<% if day.track_log? %><span class="ml-1" role="img" title="GPS track attached" aria-label="GPS track attached">📍</span><% end %>
<% if day.engine_data? %><span class="ml-1" role="img" title="Engine data attached" aria-label="Engine data attached">📈</span><% end %>
<% if day.pilots.any? %><span class="block text-xs text-slate-500"><%= day.pilots.to_sentence %></span><% end %>
</span>
<span class="text-sm tabular-nums sm:text-right"><span class="text-xs text-slate-500 sm:hidden">Tach </span><%= day.tach_time ? hours(day.tach_time) : blank %></span>
@@ -29,8 +29,8 @@
<td class="whitespace-nowrap" data-label=""><%= link_to "Leg #{i + 1}", aircraft_flight_log_path(@aircraft, fl), class: "link" %></td>
<td class="whitespace-nowrap" data-label="Route">
<%= fl.route_summary.presence || blank %>
<% if fl.track_log.attached? %><span class="ml-1" title="GPS track attached" aria-label="GPS track attached">📍</span><% end %>
<% if fl.engine_data.attached? %><span class="ml-1" title="Engine data attached" aria-label="Engine data attached">📈</span><% end %>
<% if fl.track_log.attached? %><span class="ml-1" role="img" title="GPS track attached" aria-label="GPS track attached">📍</span><% end %>
<% if fl.engine_data.attached? %><span class="ml-1" role="img" title="Engine data attached" aria-label="Engine data attached">📈</span><% end %>
</td>
<td class="text-right tabular-nums" data-label="Tach"><%= fl.tach_time ? hours(fl.tach_time) : blank %></td>
<td class="text-right tabular-nums" data-label="Hobbs"><%= fl.hobbs_time ? hours(fl.hobbs_time) : blank %></td>
+1 -1
View File
@@ -96,7 +96,7 @@
</div>
<div class="max-h-[30%] overflow-auto border-t border-slate-200">
<table class="table text-sm">
<thead><tr><th>Series <span class="font-normal normal-case text-slate-400">(visible range)</span></th><th class="text-right">Min</th><th class="text-right">Avg</th><th class="text-right">Max</th></tr></thead>
<thead><tr><th>Series <span class="font-normal normal-case text-slate-500">(visible range)</span></th><th class="text-right">Min</th><th class="text-right">Avg</th><th class="text-right">Max</th></tr></thead>
<tbody data-engine-chart-target="stats"></tbody>
</table>
</div>
+3 -3
View File
@@ -10,10 +10,10 @@
<tbody>
<% @rows.each do |row| %>
<tr>
<td class="font-medium"><%= row.type.name %><%= tag.span(" #{row.type.advisory? ? 'advisory' : row.type.limitation.to_s.downcase + ' if overdue'}", class: "text-xs text-slate-400") if row.type.advisory? || row.type.limitation %>
<td class="font-medium"><%= row.type.name %><%= tag.span(" #{row.type.advisory? ? 'advisory' : row.type.limitation.to_s.downcase + ' if overdue'}", class: "text-xs text-slate-500") if row.type.advisory? || row.type.limitation %>
<% if row.type.satisfies %><div class="text-xs text-slate-500">Also counts as <%= row.type.satisfies.name %></div><% end %></td>
<td class="text-xs"><%= row.type.interval_description %></td>
<td class="text-xs"><%= row.latest ? "#{row.latest.date} @ #{hours(row.latest.hours_at_inspection)} h" : "—" %></td>
<td class="text-xs"><%= row.latest ? "#{fmt_date(row.latest.date)} @ #{hours(row.latest.hours_at_inspection)} h" : "—" %></td>
<td class="text-xs"><%= [row.next_due_date&.to_s, row.next_due_hours && "#{hours(row.next_due_hours)} h"].compact.join(" / ").presence || "—" %></td>
<td><%= compliance_badge(row.status) %></td>
<td class="whitespace-nowrap text-right">
@@ -40,7 +40,7 @@
<tbody>
<% @history.each do |r| %>
<tr>
<td><%= r.date %></td>
<td><%= fmt_date(r.date) %></td>
<td><%= r.inspection_type.name %><%= " (#{r.component})" if r.component %></td>
<td class="text-right"><%= hours(r.hours_at_inspection) %></td>
<td class="text-xs"><%= r.notes %><% if r.logbook_entry %> <%= link_to "logbook", aircraft_logbook_entry_path(@aircraft, r.logbook_entry), class: "link" %><% end %></td>
+1 -1
View File
@@ -1,7 +1,7 @@
<% content_for :title, "Sign a logbook entry" %>
<div class="mx-auto max-w-md space-y-4">
<h1 class="text-2xl font-bold">Sign a logbook entry</h1>
<p class="text-sm text-slate-600">You've been asked to sign the <%= @entry.date %> <%= LogbookEntry::LOG_TYPES[@entry.log_type].downcase %> log entry for <%= @entry.aircraft.tail_number %>. First, sign in as <strong><%= @invitation.email %></strong>.</p>
<p class="text-sm text-slate-600">You've been asked to sign the <%= fmt_date(@entry.date) %> <%= LogbookEntry::LOG_TYPES[@entry.log_type].downcase %> log entry for <%= @entry.aircraft.tail_number %>. First, sign in as <strong><%= @invitation.email %></strong>.</p>
<div class="card card-body space-y-3">
<%= link_to "I have an account: sign in", new_session_path, class: "btn-primary w-full justify-center" %>
</div>
+3 -2
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="h-full bg-page">
<html lang="en" class="h-full bg-page">
<head>
<meta charset="utf-8">
<%= render "shared/theme_script" %>
@@ -21,6 +21,7 @@
</head>
<body class="min-h-full text-slate-800" data-controller="offline-sync">
<a href="#main" class="skip-link">Skip to content</a>
<div class="hidden space-y-1 bg-amber-50 px-4 py-2 text-center text-sm text-amber-900 ring-1 ring-amber-200" data-offline-sync-target="banner" role="status"></div>
<header class="bg-header text-white">
<div class="mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3">
@@ -77,7 +78,7 @@
</div>
</header>
<main class="mx-auto max-w-7xl px-4 py-6">
<main id="main" tabindex="-1" class="mx-auto max-w-7xl px-4 py-6 focus:outline-none">
<%= render "shared/flash" %>
<%= yield %>
</main>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
+3 -2
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="h-full bg-page">
<html lang="en" class="h-full bg-page">
<head>
<meta charset="utf-8">
<%= render "shared/theme_script" %>
@@ -18,10 +18,11 @@
<%= javascript_importmap_tags %>
</head>
<body class="min-h-full text-slate-800">
<a href="#main" class="skip-link">Skip to content</a>
<header class="bg-header text-white">
<div class="mx-auto flex max-w-7xl items-center justify-between px-4 py-3"><span class="font-semibold"><span class="text-xl">✈</span> Simple Aircraft Manager</span><%= render "shared/theme_toggle" %></div>
</header>
<main class="mx-auto max-w-7xl px-4 py-6">
<main id="main" tabindex="-1" class="mx-auto max-w-7xl px-4 py-6 focus:outline-none">
<%= render "shared/flash" %>
<%= yield %>
</main>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="bg-white" data-theme="light">
<html lang="en" class="bg-white" data-theme="light">
<head>
<meta charset="utf-8">
<title><%= [content_for(:title), "Simple Aircraft Manager"].compact.join(" · ") %></title>
+1 -1
View File
@@ -14,6 +14,6 @@
<% end %>
<% if entry.inspection_result %><dt class="text-slate-500">Result</dt><dd><%= entry.inspection_result_label %></dd><% end %>
<% if entry.signoff_location.present? %><dt class="text-slate-500">Location</dt><dd><%= entry.signoff_location %></dd><% end %>
<% if entry.supersedes %><dt class="text-slate-500">Corrects</dt><dd>The <%= entry.supersedes.date %> entry</dd><% end %>
<% if entry.supersedes %><dt class="text-slate-500">Corrects</dt><dd>The <%= fmt_date(entry.supersedes.date) %> entry</dd><% end %>
</dl>
<div class="mt-3 whitespace-pre-wrap rounded bg-slate-50 p-3 font-mono text-sm"><%= entry.text %></div>
+1 -1
View File
@@ -3,7 +3,7 @@
<% if entry.supersedes %>
<%= f.hidden_field :supersedes_id %>
<p class="rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-900 ring-1 ring-amber-200">
Correcting the signed <%= link_to "#{entry.supersedes.date} entry", aircraft_logbook_entry_path(aircraft, entry.supersedes), class: "link" %>.
Correcting the signed <%= link_to "#{fmt_date(entry.supersedes.date)} entry", aircraft_logbook_entry_path(aircraft, entry.supersedes), class: "link" %>.
Change what's wrong, save, then sign it: the original's signature is then marked superseded (it's kept, not deleted).
</p>
<% end %>
@@ -9,6 +9,6 @@
<div class="mt-1 text-xs text-slate-500">
Status: <strong><%= sig.imported? ? "Signed on #{sig.origin} (imported)" : sig.status_label %></strong>
· Fingerprint <span class="font-mono"><%= sig.content_digest.first(16) %>…</span>
<% if entry.superseded_by %> · Corrected by <%= link_to "the #{entry.superseded_by.date} entry", aircraft_logbook_entry_path(entry.aircraft, entry.superseded_by), class: "link" %><% end %>
<% if entry.superseded_by %> · Corrected by <%= link_to "the #{fmt_date(entry.superseded_by.date)} entry", aircraft_logbook_entry_path(entry.aircraft, entry.superseded_by), class: "link" %><% end %>
</div>
</div>
+2 -2
View File
@@ -24,11 +24,11 @@
<tbody>
<% @entries.each do |e| %>
<tr>
<td class="whitespace-nowrap"><input type="checkbox" name="ids[]" value="<%= e.id %>" form="print-entries" class="mr-1 align-middle" aria-label="Select the <%= e.date %> entry"><%= link_to e.date, aircraft_logbook_entry_path(@aircraft, e), class: "link" %></td>
<td class="whitespace-nowrap"><input type="checkbox" name="ids[]" value="<%= e.id %>" form="print-entries" class="mr-1 align-middle" aria-label="Select the <%= fmt_date(e.date) %> entry"><%= link_to e.date, aircraft_logbook_entry_path(@aircraft, e), class: "link" %></td>
<td><span class="badge-gray"><%= LogbookEntry::LOG_TYPES[e.log_type] %></span></td>
<td class="text-xs"><%= LogbookEntry::ENTRY_TYPES[e.entry_type] %></td>
<td class="text-right tabular-nums"><%= hours(e.aircraft_hours_at_entry) %></td>
<td class="max-w-xl"><%= e.text.truncate(220) %> <%= "📄" if e.document %>
<td class="max-w-xl"><%= e.text.truncate(220) %> <% if e.document %><span role="img" title="Has a scanned page" aria-label="Has a scanned page">📄</span><% end %>
<% unless e.verified? %><span class="badge-orange" title="Transcribed by Claude<%= " (#{e.transcription_confidence} confidence)" if e.transcription_confidence %>; check it against the scan">Unverified</span><% end %></td>
<td class="text-xs text-slate-500"><%= e.signoff_person %><%= " ##{e.signoff_certificate_number}" if e.signoff_certificate_number %><% if e.signoff_location.present? %><br><%= e.signoff_location %><% end %>
<% if e.signature %><br><span class="<%= e.superseded? ? 'badge-orange' : 'badge-green' %>" title="Signed electronically by <%= e.signature.signer_name %>"><%= e.superseded? ? "Superseded" : "Signed" %></span>
+1 -1
View File
@@ -18,7 +18,7 @@
<div class="card-body space-y-3">
<% if @entry.signed? %><%= render "logbook_entries/signature", entry: @entry %>
<% elsif LogbookEntry::RECORD_TYPES.include?(@entry.entry_type) %>
<p class="rounded-md bg-slate-50 px-3 py-2 text-sm text-slate-600 ring-1 ring-slate-200">Not signed electronically.<%= " Pending correction of the #{@entry.supersedes.date} entry." if @entry.supersedes %> Sign it here, or print it and sign the paper copy.</p>
<p class="rounded-md bg-slate-50 px-3 py-2 text-sm text-slate-600 ring-1 ring-slate-200">Not signed electronically.<%= " Pending correction of the #{fmt_date(@entry.supersedes.date)} entry." if @entry.supersedes %> Sign it here, or print it and sign the paper copy.</p>
<% end %>
<% unless @entry.verified? %>
<div class="flex flex-wrap items-center justify-between gap-2 rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-900 ring-1 ring-amber-200">
+1 -1
View File
@@ -9,7 +9,7 @@
<% @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"><%= e.date %></span> · <%= LogbookEntry::LOG_TYPES[e.log_type] %> · <%= e.text.truncate(90) %>
<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">(missing <%= missing.to_sentence %>)</span><% end %></li>
<% end %>
</ul>
+6 -6
View File
@@ -52,9 +52,9 @@
<tbody>
<% @report.life_limited.each do |c| %>
<tr><td class="<%= td %>"><%= c %> <span class="text-slate-500"><%= c.model %></span></td><td class="<%= td %>"><%= c.serial_number.presence || "—" %></td>
<td class="<%= td %>"><%= [ (c.replacement_hours && "#{hours(c.replacement_hours)} hrs"), (c.replacement_days && "#{c.replacement_days} days"), (c.expires_on && "expires #{c.expires_on}") ].compact.join(" / ") %></td>
<td class="<%= td %>"><%= [ (c.replacement_hours && "#{hours(c.replacement_hours)} hrs"), (c.replacement_days && "#{c.replacement_days} days"), (c.expires_on && "expires #{fmt_date(c.expires_on)}") ].compact.join(" / ") %></td>
<td class="<%= td %> text-right tabular-nums"><%= hours(c.hours_since_overhaul) %> hrs</td>
<td class="<%= td %>"><%= [ (c.hours_to_replacement && "#{hours(c.hours_to_replacement)} hrs"), (c.next_replacement_date && "by #{c.next_replacement_date}") ].compact.join(", ") %></td>
<td class="<%= td %>"><%= [ (c.hours_to_replacement && "#{hours(c.hours_to_replacement)} hrs"), (c.next_replacement_date && "by #{fmt_date(c.next_replacement_date)}") ].compact.join(", ") %></td>
<td class="<%= td %>"><%= life_badge(c.life_status) %></td></tr>
<% end %>
</tbody>
@@ -90,7 +90,7 @@
<% last = row.latest %>
<tr><td class="<%= td %>"><%= row.type.name %><% if row.type.satisfies %><div class="text-xs text-slate-500">Also counts as <%= row.type.satisfies.name %></div><% end %></td>
<td class="<%= td %> text-xs"><%= row.type.interval_description %></td>
<td class="<%= td %>"><%= last ? "#{last.date}#{" @ #{hours(last.hours_at_inspection)}" if last.hours_at_inspection}" : "Never" %><%= " (#{last.inspection_type.name})" if last && last.inspection_type != row.type %></td>
<td class="<%= td %>"><%= last ? "#{fmt_date(last.date)}#{" @ #{hours(last.hours_at_inspection)}" if last.hours_at_inspection}" : "Never" %><%= " (#{last.inspection_type.name})" if last && last.inspection_type != row.type %></td>
<td class="<%= td %> text-right tabular-nums"><%= last&.hours_at_inspection ? "#{hours(@report.time_in_service - last.hours_at_inspection)} hrs" : "—" %></td>
<td class="<%= td %>"><%= [ row.next_due_date&.to_s, row.next_due_hours && "#{hours(row.next_due_hours)} hrs" ].compact.join(" / ").presence || "—" %></td>
<td class="<%= td %>"><%= compliance_badge(row.status) %></td></tr>
@@ -129,7 +129,7 @@
<thead><tr><th class="<%= th %>">Date</th><th class="<%= th %>">Type</th><th class="<%= th %>">Description</th><th class="<%= th %>">STC</th><th class="<%= th %>">Form 337</th></tr></thead>
<tbody>
<% majors.each do |m| %>
<tr><td class="<%= td %>"><%= m.date_performed %></td><td class="<%= td %> text-xs"><%= m.type_label %></td>
<tr><td class="<%= td %>"><%= fmt_date(m.date_performed) %></td><td class="<%= td %> text-xs"><%= m.type_label %></td>
<td class="<%= td %>"><%= m.title %><%= " · #{m.component}" if m.component %></td>
<td class="<%= td %> text-xs"><%= [ m.stc_number, m.stc_holder ].compact_blank.join(", ").presence || "—" %></td>
<td class="<%= td %> text-xs"><%= m.form_337_document ? "On file" : "—" %></td></tr>
@@ -142,7 +142,7 @@
<section class="<%= section %>">
<h2 class="text-base font-semibold">Weight and balance</h2>
<% if (wb = a.current_weight_balance) %>
<p class="mt-1 text-sm">Empty weight <strong><%= number_with_precision(wb.empty_weight, precision: 1, delimiter: ",") %> lb</strong>, CG <strong><%= number_with_precision(wb.empty_arm, precision: 2) %> in</strong><%= ", useful load #{number_with_precision(wb.useful_load, precision: 1, delimiter: ',')} lb" if wb.useful_load %>, as of <%= wb.date %><%= " (#{wb.reason})" if wb.reason.present? %>.</p>
<p class="mt-1 text-sm">Empty weight <strong><%= number_with_precision(wb.empty_weight, precision: 1, delimiter: ",") %> lb</strong>, CG <strong><%= number_with_precision(wb.empty_arm, precision: 2) %> in</strong><%= ", useful load #{number_with_precision(wb.useful_load, precision: 1, delimiter: ',')} lb" if wb.useful_load %>, as of <%= fmt_date(wb.date) %><%= " (#{wb.reason})" if wb.reason.present? %>.</p>
<% else %><p class="mt-1 text-sm text-slate-500">None recorded.</p><% end %>
</section>
@@ -150,7 +150,7 @@
<h2 class="text-base font-semibold">Open discrepancies</h2>
<% if (squawks = @report.open_squawks.to_a).any? %>
<ul class="mt-2 space-y-1 text-sm">
<% squawks.each do |s| %><li><%= squawk_priority_badge(s) %> <%= s.issue_reported %><%= " · #{s.component}" if s.component %> <span class="text-xs text-slate-500">(<%= s.created_at.to_date %>)</span></li><% end %>
<% squawks.each do |s| %><li><%= squawk_priority_badge(s) %> <%= s.issue_reported %><%= " · #{s.component}" if s.component %> <span class="text-xs text-slate-500">(<%= fmt_date(s.created_at.to_date) %>)</span></li><% end %>
</ul>
<% else %><p class="mt-1 text-sm text-slate-500">None open.</p><% end %>
</section>
+1 -1
View File
@@ -11,7 +11,7 @@
<tbody>
<% @records.each do |r| %>
<tr>
<td class="whitespace-nowrap"><%= r.date_performed %></td>
<td class="whitespace-nowrap"><%= fmt_date(r.date_performed) %></td>
<td><%= tag.span r.type_label, class: r.record_type == "repair" ? "badge-orange" : "badge-blue" %></td>
<td><%= link_to r.title, aircraft_major_record_path(@aircraft, r), class: "link" %><%= tag.div(r.component, class: "text-xs text-slate-500") if r.component %></td>
<td class="text-xs"><%= r.performed_by %></td>
+1 -1
View File
@@ -14,7 +14,7 @@
<dt class="text-slate-500">Weight & balance</dt>
<dd>
<% if (wb = @aircraft.weight_balance_records.where(major_record: @record).recent_first.first) %>
<%= link_to "#{wb.date}: #{number_with_precision(wb.empty_weight, precision: 1)} lb @ #{number_with_precision(wb.empty_arm, precision: 2)} in", aircraft_weight_balance_records_path(@aircraft), class: "link" %>
<%= link_to "#{fmt_date(wb.date)}: #{number_with_precision(wb.empty_weight, precision: 1)} lb @ #{number_with_precision(wb.empty_arm, precision: 2)} in", aircraft_weight_balance_records_path(@aircraft), class: "link" %>
<% elsif owner? %>
<%= link_to "Record the new W&B", new_aircraft_weight_balance_record_path(@aircraft, major_record_id: @record.id), class: "link" %>
<% else %>—<% end %>
+2 -2
View File
@@ -34,7 +34,7 @@
<section class="card card-body mt-5 max-w-md" id="two-factor">
<h2 class="card-title">Two-factor sign-in</h2>
<% if @user.otp_enabled? %>
<p class="mt-1 text-sm text-slate-600"><span class="badge-green">On</span> since <%= @user.otp_enabled_at.to_date %>: signing in with your password or an emailed link also asks for a code from your authenticator app. <%= @user.recovery_codes_left %> recovery codes left.</p>
<p class="mt-1 text-sm text-slate-600"><span class="badge-green">On</span> since <%= fmt_date(@user.otp_enabled_at.to_date) %>: signing in with your password or an emailed link also asks for a code from your authenticator app. <%= @user.recovery_codes_left %> recovery codes left.</p>
<%= form_with url: two_factor_path, class: "mt-3 flex flex-wrap items-end gap-2" do |f| %>
<div><%= label_tag :code, "Current code or a recovery code", class: "label" %><%= text_field_tag :code, nil, required: true, autocomplete: "one-time-code", class: "input w-44" %></div>
<%= button_tag "New recovery codes", type: "submit", formaction: recovery_codes_two_factor_path, class: "btn-secondary btn-sm" %>
@@ -71,7 +71,7 @@
<% @user.certificates.each do |c| %>
<li class="flex flex-wrap items-center justify-between gap-2 px-3 py-2 text-sm">
<span><span class="font-medium"><%= c.kind_label %></span> · <%= c.number %>
<% if c.expires_on %><span class="ml-1 <%= c.expired? ? 'badge-red' : (Date.current + UserCertificate::EXPIRY_WARNING_DAYS >= c.expires_on ? 'badge-orange' : 'badge-gray') %>"><%= c.expired? ? "Expired" : "Expires" %> <%= c.expires_on %></span><% end %></span>
<% if c.expires_on %><span class="ml-1 <%= c.expired? ? 'badge-red' : (Date.current + UserCertificate::EXPIRY_WARNING_DAYS >= c.expires_on ? 'badge-orange' : 'badge-gray') %>"><%= c.expired? ? "Expired" : "Expires" %> <%= fmt_date(c.expires_on) %></span><% end %></span>
<%= button_to "Remove", certificate_path(c), method: :delete, class: "btn-secondary btn-sm", form: { data: { turbo_confirm: "Remove your #{c.kind_label} certificate?" } } %>
</li>
<% end %>
+1 -1
View File
@@ -15,7 +15,7 @@
<% if @certificates.any? %>
<h3 style="margin: 16px 0 4px;">Your certificates</h3>
<ul style="margin: 0; padding-left: 20px;">
<% @certificates.each do |c| %><li><strong><%= c.expired? ? "Expired" : "Expires" %> <%= c.expires_on %>:</strong> <%= c.kind_label %> <%= c.number %></li><% end %>
<% @certificates.each do |c| %><li><strong><%= c.expired? ? "Expired" : "Expires" %> <%= fmt_date(c.expires_on) %>:</strong> <%= c.kind_label %> <%= c.number %></li><% end %>
</ul>
<% end %>
<% if @drs_due.any? %><p><strong>Refresh the AD list from FAA DRS</strong> (new ADs are found weekly, but revisions and anything missed come from a fresh import):</p>
+1 -1
View File
@@ -13,7 +13,7 @@ Here's what needs attention<%= " on your aircraft" if @items.any? %>.
Your certificates:
<% @certificates.each do |c| %>
- <%= c.expired? ? "Expired" : "Expires" %> <%= c.expires_on %>: <%= c.kind_label %> <%= c.number %>
- <%= c.expired? ? "Expired" : "Expires" %> <%= fmt_date(c.expires_on) %>: <%= c.kind_label %> <%= c.number %>
<% end %>
<% end %>
<% if @drs_due.any? %>
+1 -1
View File
@@ -7,7 +7,7 @@
<% end %>
<% if Sso.password_login? %>
<% if Sso.enabled? %>
<div class="flex items-center gap-3 text-xs text-slate-400"><span class="h-px flex-1 bg-slate-200"></span>or<span class="h-px flex-1 bg-slate-200"></span></div>
<div class="flex items-center gap-3 text-xs text-slate-500"><span class="h-px flex-1 bg-slate-200"></span>or<span class="h-px flex-1 bg-slate-200"></span></div>
<% end %>
<%= form_with url: session_path, class: "space-y-4" do |form| %>
<div><%= form.label :email_address, "Email", class: "label" %>
+1 -1
View File
@@ -3,7 +3,7 @@
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-3">
<% if aircraft.picture.attached? %>
<%= image_tag aircraft.picture, class: "h-12 w-12 rounded-md object-cover" %>
<%= image_tag aircraft.picture, class: "h-12 w-12 rounded-md object-cover", alt: "" %>
<% end %>
<div>
<h1 class="text-2xl font-bold tracking-tight">
+7 -7
View File
@@ -1,7 +1,7 @@
<% content_for :title, @aircraft.tail_number %>
<div class="mb-5 flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-3">
<% if @aircraft.picture.attached? %><%= image_tag rails_blob_path(@aircraft.picture, disposition: :inline), class: "h-16 w-16 rounded-md object-cover" %><% end %>
<% if @aircraft.picture.attached? %><%= image_tag rails_blob_path(@aircraft.picture, disposition: :inline), class: "h-16 w-16 rounded-md object-cover", alt: "Photo of #{@aircraft.tail_number}" %><% end %>
<div>
<h1 class="text-2xl font-bold"><%= @aircraft.tail_number %> <span class="text-base font-normal text-slate-500"><%= [@aircraft.make, @aircraft.model].compact_blank.join(" ") %></span></h1>
<div class="mt-1 flex flex-wrap items-center gap-2 text-sm">
@@ -67,7 +67,7 @@
<% if @notes.any? %>
<section class="card"><div class="card-header"><h2 class="card-title">Notes</h2></div>
<ul class="divide-y divide-slate-100"><% @notes.each do |n| %><li class="px-4 py-2 text-sm"><%= markdown n.text %><div class="text-xs text-slate-500"><%= n.created_at.to_date %></div></li><% end %></ul></section>
<ul class="divide-y divide-slate-100"><% @notes.each do |n| %><li class="px-4 py-2 text-sm"><%= markdown n.text %><div class="text-xs text-slate-500"><%= fmt_date(n.created_at.to_date) %></div></li><% end %></ul></section>
<% end %>
<% if @documents.any? %>
@@ -81,23 +81,23 @@
<% if @share.maintenance? %>
<section class="card"><div class="card-header"><h2 class="card-title">Logbook</h2></div>
<% if @logbook.any? %><table class="table"><tbody><% @logbook.each do |e| %><tr>
<td class="whitespace-nowrap"><%= e.date %></td><td><span class="badge-gray"><%= LogbookEntry::LOG_TYPES[e.log_type] %></span></td>
<td class="whitespace-nowrap"><%= fmt_date(e.date) %></td><td><span class="badge-gray"><%= LogbookEntry::LOG_TYPES[e.log_type] %></span></td>
<td class="text-right"><%= hours(e.aircraft_hours_at_entry) %></td><td class="whitespace-pre-wrap text-xs"><%= e.text %></td><td class="text-xs"><%= e.signoff_person %></td></tr><% end %></tbody></table>
<% else %><%= empty_state "No entries." %><% end %></section>
<div class="grid gap-5 lg:grid-cols-2">
<section class="card"><div class="card-header"><h2 class="card-title">Inspection History</h2></div>
<table class="table"><tbody><% @inspection_history.each do |r| %><tr><td><%= r.date %></td><td><%= r.inspection_type.name %></td><td class="text-right"><%= hours(r.hours_at_inspection) %></td></tr><% end %></tbody></table></section>
<table class="table"><tbody><% @inspection_history.each do |r| %><tr><td><%= fmt_date(r.date) %></td><td><%= r.inspection_type.name %></td><td class="text-right"><%= hours(r.hours_at_inspection) %></td></tr><% end %></tbody></table></section>
<section class="card"><div class="card-header"><h2 class="card-title">AD Compliance History</h2></div>
<table class="table"><tbody><% @ad_history.each do |c| %><tr><td class="whitespace-nowrap"><%= c.date_complied %></td><td><%= ad_link(c.airworthiness_directive) %><div class="text-xs text-slate-500"><%= c.airworthiness_directive.short_description %></div></td><td class="text-xs"><%= c.not_applicable? ? "N/A: " : "" %><%= c.compliance_notes %></td></tr><% end %></tbody></table></section>
<table class="table"><tbody><% @ad_history.each do |c| %><tr><td class="whitespace-nowrap"><%= fmt_date(c.date_complied) %></td><td><%= ad_link(c.airworthiness_directive) %><div class="text-xs text-slate-500"><%= c.airworthiness_directive.short_description %></div></td><td class="text-xs"><%= c.not_applicable? ? "N/A: " : "" %><%= c.compliance_notes %></td></tr><% end %></tbody></table></section>
</div>
<section class="card"><div class="card-header"><h2 class="card-title">Major Repairs & Alterations</h2></div>
<% if @major_records.any? %><table class="table"><tbody><% @major_records.each do |r| %><tr><td><%= r.date_performed %></td><td><%= r.type_label %></td><td><%= r.title %><div class="text-xs text-slate-500"><%= r.description %></div></td><td class="text-xs"><%= r.stc_number %></td></tr><% end %></tbody></table>
<% if @major_records.any? %><table class="table"><tbody><% @major_records.each do |r| %><tr><td><%= fmt_date(r.date_performed) %></td><td><%= r.type_label %></td><td><%= r.title %><div class="text-xs text-slate-500"><%= r.description %></div></td><td class="text-xs"><%= r.stc_number %></td></tr><% end %></tbody></table>
<% else %><%= empty_state "None recorded." %><% end %></section>
<section class="card"><div class="card-header"><h2 class="card-title">Resolved Squawks</h2></div>
<% if @resolved_squawks.any? %><ul class="divide-y divide-slate-100"><% @resolved_squawks.each do |s| %><li class="px-4 py-2 text-sm"><%= squawk_priority_badge(s) %> <%= s.issue_reported %> <span class="text-xs text-slate-500">resolved <%= s.resolved_at&.to_date %></span></li><% end %></ul>
<% if @resolved_squawks.any? %><ul class="divide-y divide-slate-100"><% @resolved_squawks.each do |s| %><li class="px-4 py-2 text-sm"><%= squawk_priority_badge(s) %> <%= s.issue_reported %> <span class="text-xs text-slate-500">resolved <%= fmt_date(s.resolved_at&.to_date) %></span></li><% end %></ul>
<% else %><%= empty_state "None." %><% end %></section>
<% end %>
</div>
+1 -1
View File
@@ -1,6 +1,6 @@
<p>You electronically signed a logbook entry.</p>
<p>Aircraft: <strong><%= @entry.aircraft.tail_number %></strong><br>
Entry: <%= @entry.date %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log<br>
Entry: <%= fmt_date(@entry.date) %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log<br>
Certified by: <%= @signature.signer_name %>, <%= @signature.certificate_label %> <%= @signature.certificate_number %><br>
Signed: <%= @signature.signed_at.utc.strftime("%Y-%m-%d %H:%M:%S UTC") %></p>
<p>Statement: <em><%= @signature.statement %></em></p>
+1 -1
View File
@@ -1,7 +1,7 @@
You electronically signed a logbook entry.
Aircraft: <%= @entry.aircraft.tail_number %>
Entry: <%= @entry.date %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log
Entry: <%= fmt_date(@entry.date) %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log
Certified by: <%= @signature.signer_name %>, <%= @signature.certificate_label %> <%= @signature.certificate_number %>
Signed: <%= @signature.signed_at.utc.strftime("%Y-%m-%d %H:%M:%S UTC") %>
Statement: <%= @signature.statement %>
@@ -1,4 +1,4 @@
<p><%= @invitation.invited_by&.display_name || "The owner" %> asks you to sign a logbook entry for <strong><%= @entry.aircraft.tail_number %></strong> (<%= @entry.date %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log).</p>
<p><%= @invitation.invited_by&.display_name || "The owner" %> asks you to sign a logbook entry for <strong><%= @entry.aircraft.tail_number %></strong> (<%= fmt_date(@entry.date) %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log).</p>
<% if @invitation.message.present? %><p><em>“<%= @invitation.message %>”</em></p><% end %>
<p><%= link_to "Review and sign the entry", @url %> (the link works once, until <%= @invitation.expires_at.to_date %>).</p>
<p><%= link_to "Review and sign the entry", @url %> (the link works once, until <%= fmt_date(@invitation.expires_at.to_date) %>).</p>
<p style="color:#64748b;font-size:12px">You'll sign in or create an account for <%= @invitation.email %>, add your certificate, and sign with your password.</p>
@@ -1,10 +1,10 @@
<%= @invitation.invited_by&.display_name || "The owner" %> asks you to sign a logbook entry for <%= @entry.aircraft.tail_number %> (<%= @entry.date %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log).
<%= @invitation.invited_by&.display_name || "The owner" %> asks you to sign a logbook entry for <%= @entry.aircraft.tail_number %> (<%= fmt_date(@entry.date) %>, <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log).
<% if @invitation.message.present? %>
"<%= @invitation.message %>"
<% end %>
Review and sign it here (the link works once, until <%= @invitation.expires_at.to_date %>):
Review and sign it here (the link works once, until <%= fmt_date(@invitation.expires_at.to_date) %>):
<%= @url %>
You'll sign in or create an account for <%= @invitation.email %>, add your certificate, and sign with your password.
+1 -1
View File
@@ -4,7 +4,7 @@
<h2 class="card-title">Ask someone to sign</h2>
<p class="text-sm text-slate-600">For a mechanic who did the work: they get a one-time link by email, sign in or create their own account, add their certificate, and sign this entry with their own password. They see only this entry.</p>
<%= f.errors_summary %>
<div class="rounded-md bg-slate-50 p-3 text-sm"><%= @entry.date %> · <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log · <%= @entry.text.truncate(160) %></div>
<div class="rounded-md bg-slate-50 p-3 text-sm"><%= fmt_date(@entry.date) %> · <%= LogbookEntry::LOG_TYPES[@entry.log_type] %> log · <%= @entry.text.truncate(160) %></div>
<%= f.field :email, as: :email, label: "Their email", required: true %>
<%= f.field :message, as: :textarea, rows: 2, label: "Message (optional)" %>
<div class="flex gap-2"><%= f.submit "Send invitation" %><%= link_to "Cancel", aircraft_logbook_entry_path(@aircraft, @entry), class: "btn-secondary" %></div>
+2 -2
View File
@@ -9,10 +9,10 @@
<%= 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 %>, <%= 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"><%= 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 %>
</td>
<td><%= s.component&.to_s || "—" %></td>
<td class="whitespace-nowrap text-xs text-slate-500"><%= s.created_at.to_date %><br><%= s.reported_by&.display_name %></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 s.deferred? %>
+2 -2
View File
@@ -18,8 +18,8 @@
<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 #{s.logbook_entry.date}", aircraft_logbook_entry_path(@aircraft, s.logbook_entry), class: "link" %></div><% end %></td>
<td class="text-xs text-slate-500"><%= s.resolved_at&.to_date %></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-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>
</tr>
<% end %>
@@ -77,7 +77,7 @@
<tbody>
<% @records.each do |r| %>
<tr>
<td class="whitespace-nowrap"><%= r.date %></td>
<td class="whitespace-nowrap"><%= fmt_date(r.date) %></td>
<td class="text-right tabular-nums"><%= number_with_precision(r.empty_weight, precision: 1, delimiter: ",") %> lb</td>
<td class="text-right tabular-nums"><%= number_with_precision(r.empty_arm, precision: 2) %> in</td>
<td class="text-right tabular-nums"><%= r.useful_load ? "#{number_with_precision(r.useful_load, precision: 1, delimiter: ',')} lb" : "—" %></td>
+27
View File
@@ -0,0 +1,27 @@
require "test_helper"
# Basics every page shares: language, skip link, alt text, and the date format.
class AccessibilityTest < ActionDispatch::IntegrationTest
setup do
@owner = create_user("owner@example.com")
@a = create_aircraft(owner: @owner, tail_number: "N12345")
sign_in @owner
end
test "pages declare their language and let keyboard users skip to the content" do
[ root_path, aircraft_path(@a), aircraft_logbook_entries_path(@a), help_path ].each do |path|
get path
assert_select "html[lang=en]"
assert_select "a.skip-link[href='#main']", text: "Skip to content"
assert_select "main#main"
assert_select "img:not([alt])", 0, "#{path}: every image has alt text"
end
end
test "dates read the same way everywhere" do
@a.logbook_entries.create!(date: Date.new(2026, 11, 8), entry_type: "MAINTENANCE", text: "Changed oil", aircraft_hours_at_entry: 1000)
get aircraft_logbook_entries_path(@a)
assert_includes response.body, "Nov 8, 2026"
refute_includes response.body, "November 08, 2026"
end
end
+1 -1
View File
@@ -70,7 +70,7 @@ class AdImportFlowTest < ActionDispatch::IntegrationTest
assert_equal Date.new(2026, 9, 3), AdWatch.new(@aircraft).start_date # last import less 60 days
sign_in @owner
get aircraft_airworthiness_directives_path(@aircraft)
assert_includes response.body, "Last import <strong>2026-11-02</strong>"
assert_includes response.body, "Last import <strong>Nov 2, 2026</strong>"
end
travel_to Time.zone.local(2027, 12, 1) do # over a year: the first Monday-of-month email and the audit flag it
assert DrsImport.renewal_due?(@aircraft)
@@ -24,6 +24,6 @@ class ConsumableRecordsPagingTest < ActionDispatch::IntegrationTest
assert_select "turbo-frame#consumable-records-3", 0
assert_select "thead", 0 # header only on the first page
assert_select "h2", text: "Fuel Burn", count: 0
assert_includes response.body, "2026-01-01" # the oldest record is reachable
assert_includes response.body, "Jan 1, 2026" # the oldest record is reachable
end
end
+1 -1
View File
@@ -134,7 +134,7 @@ class GroupFourTest < ActionDispatch::IntegrationTest
assert_select "input[data-wb-calculator-target=station][data-fuel=true][data-arm='48.0']"
assert_select "input[data-wb-calculator-target=burn]"
get aircraft_major_record_path(@a, alteration)
assert_includes response.body, "2026-01-01: 1500.0 lb @ 39.50 in"
assert_includes response.body, "Jan 1, 2026: 1500.0 lb @ 39.50 in"
get aircraft_report_path(@a)
assert_includes response.body, "Empty weight <strong>1,500.0 lb</strong>"
+1 -1
View File
@@ -55,7 +55,7 @@ class SquawkWorkflowTest < ActionDispatch::IntegrationTest
assert @squawk.resolved?
assert_equal [ "MAINTENANCE", "AP", "7654321", [] ], [ entry.entry_type, entry.signoff_certificate_type, entry.signoff_certificate_number, entry.missing_record_items ]
get aircraft_squawks_path(@a)
assert_select "a[href='#{aircraft_logbook_entry_path(@a, entry)}']", text: "Logbook 2026-11-01"
assert_select "a[href='#{aircraft_logbook_entry_path(@a, entry)}']", text: "Logbook Nov 1, 2026"
other = @a.squawks.create!(priority: 2, issue_reported: "Chipped paint")
patch resolve_aircraft_squawk_path(@a, other), params: { logbook: "existing", logbook_entry_id: entry.id }