mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Recordkeeping procedures, QC audits and user instructions (AC 120-78B)
- Admin → Recordkeeping Procedures: generated procedures document (2.2.11 / 3.2.8) from the system setup plus owner-entered details; adopted as numbered, immutable revisions; included in the records package - Admin → Records Audits: periodic QC checklist (3.2.8.5) combining app checks with a restore test, sampled entries vs. source documents and a user review; next due date on About and in admins' weekly reminder - User instructions at /help/records, linked from the logbook and signing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
68a1719db2
commit
761f381679
27 files changed
+668
-10
No files matched your search
@@ -93,7 +93,10 @@
|
||||
[ "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" ],
|
||||
[ "Backup check", backup&.message ],
|
||||
[ "Backups kept", "#{Setting.integer('backups_kept')} (in storage/backups)" ]
|
||||
[ "Backups kept", "#{Setting.integer('backups_kept')} (in storage/backups)" ],
|
||||
[ "Procedures", (r = ProceduresRevision.current) ? "Revision #{r.number}, adopted #{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 ]
|
||||
] %>
|
||||
<% if check && !check.ok %>
|
||||
<ul class="list-disc space-y-1 px-8 pb-3 text-sm text-red-700"><% check.problems.each do |p| %><li><%= p %></li><% end %></ul>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<% content_for :title, "Records audits" %>
|
||||
<div class="mb-4 flex flex-wrap items-center justify-between gap-2">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Records audits</h1>
|
||||
<p class="text-sm text-slate-600">Quality-control audits of the electronic records (AC 120-78B 3.2.8.5), every <%= RecordkeepingPolicy.current.audit_interval_months %> months. Next due <strong class="<%= AuditRun.due_soon? ? 'text-amber-700' : '' %>"><%= AuditRun.next_due %></strong>.</p>
|
||||
</div>
|
||||
<%= link_to "Start an audit", new_admin_audit_path, class: "btn-primary" %>
|
||||
</div>
|
||||
<section class="card">
|
||||
<% if @audits.any? %>
|
||||
<ul class="divide-y divide-slate-100 text-sm">
|
||||
<% @audits.each do |a| %>
|
||||
<li class="flex items-center justify-between px-4 py-2">
|
||||
<span><%= link_to a.performed_at.to_date, admin_audit_path(a), class: "link" %> · <%= a.performed_by&.display_name %></span>
|
||||
<span class="<%= a.passed ? 'badge-green' : 'badge-orange' %>"><%= a.passed ? "Passed" : "Items not passed" %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %><%= empty_state "No audits yet." %><% end %>
|
||||
</section>
|
||||
@@ -0,0 +1,39 @@
|
||||
<% content_for :title, "Records audit" %>
|
||||
<h1 class="mb-1 text-2xl font-bold">Records audit</h1>
|
||||
<p class="mb-5 text-sm text-slate-600">Work through each item; the app has checked the first ones itself.</p>
|
||||
<%= form_with url: admin_audits_path, class: "space-y-5" do %>
|
||||
<section class="card">
|
||||
<div class="card-header"><h2 class="card-title">Checked by the app</h2></div>
|
||||
<ul class="divide-y divide-slate-100 text-sm">
|
||||
<% @audit.auto_items.each do |item| %>
|
||||
<li class="flex items-start gap-3 px-4 py-2"><span class="<%= item.passed ? 'badge-green' : 'badge-red' %>"><%= item.passed ? "Pass" : "Fail" %></span>
|
||||
<span><span class="font-medium"><%= item.title %></span><span class="block text-xs text-slate-500"><%= item.detail %></span></span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<% sample = @audit.sample %>
|
||||
<section class="card">
|
||||
<div class="card-header"><h2 class="card-title">Confirmed by you</h2></div>
|
||||
<div class="space-y-4 p-4">
|
||||
<% RecordsAudit::MANUAL.each do |key, title| %>
|
||||
<div class="space-y-2 rounded-md p-3 ring-1 ring-slate-200">
|
||||
<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 == "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 %>
|
||||
<% if sample.empty? %><li>No entries since the last audit.</li><% end %>
|
||||
</ul>
|
||||
<% elsif key == "users" %>
|
||||
<ul class="ml-6 list-disc text-xs text-slate-600">
|
||||
<% @audit.users.each do |u| %><li><%= u.display_name %> (<%= u.email_address %>)<%= " · admin" if u.admin? %><%= " · #{u.aircraft_roles.map { "#{_1.role} #{_1.aircraft.tail_number}" }.join(', ')}" if u.aircraft_roles.any? %> · last sign-in <%= u.last_signed_in_at ? time_ago_in_words(u.last_signed_in_at) + " ago" : "never" %><%= " · DISABLED" if u.disabled? %></li><% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<%= text_field_tag "answers[#{key}][note]", nil, class: "input", placeholder: "Note (what was checked, or what's being done)" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div><%= label_tag :notes, "Overall notes", class: "label" %><%= text_area_tag :notes, nil, rows: 3, class: "input" %></div>
|
||||
<%= submit_tag "Record audit", class: "btn-primary" %>
|
||||
</div>
|
||||
</section>
|
||||
<% end %>
|
||||
@@ -0,0 +1,14 @@
|
||||
<% content_for :title, "Records audit" %>
|
||||
<h1 class="mb-1 text-2xl font-bold">Records audit, <%= @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"] %>
|
||||
<% if r["detail"].present? %><span class="block text-xs text-slate-600"><%= r["detail"] %></span><% end %></span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if @audit.notes.present? %><div class="whitespace-pre-wrap border-t border-slate-100 px-4 py-3 text-sm"><%= @audit.notes %></div><% end %>
|
||||
</section>
|
||||
<p class="mt-4"><%= link_to "All audits", admin_audits_path, class: "link" %></p>
|
||||
@@ -0,0 +1,115 @@
|
||||
<%# The procedures document (AC 120-78B 2.2.11, 3.2.8), generated from the system's setup.
|
||||
Locals: policy, number, adopted_at, adopted_by, revisions, summary. %>
|
||||
<% info = SystemInfo.new %>
|
||||
<% aircraft = Aircraft.ordered.includes(:roles) %>
|
||||
<% users = User.order(:email_address).includes(:certificates, aircraft_roles: :aircraft) %>
|
||||
<% h2 = "mt-6 text-base font-semibold" %>
|
||||
<% p_ = "mt-1 text-sm leading-relaxed" %>
|
||||
<article class="text-slate-900">
|
||||
<header class="border-b-2 border-slate-800 pb-3">
|
||||
<p class="text-xs uppercase tracking-wide text-slate-500">Standalone procedures document · AC 120-78B paragraphs 2.2.11 and 3.2.8</p>
|
||||
<h1 class="text-2xl font-bold">Electronic Signature and Recordkeeping Procedures</h1>
|
||||
<p class="text-sm text-slate-600"><%= policy.operator_name.presence || "[Operator]" %> · Simple Aircraft Manager</p>
|
||||
<p class="mt-1 text-sm"><strong>Revision <%= number %></strong><%= adopted_at ? " · adopted #{adopted_at.to_date.iso8601} by #{adopted_by&.display_name}" : " · not yet adopted" %></p>
|
||||
</header>
|
||||
|
||||
<h2 class="<%= h2 %>">1. Purpose and scope</h2>
|
||||
<p class="<%= p_ %>">These procedures describe how <%= policy.operator_name.presence || "[Operator]" %> keeps the maintenance records required by 14 CFR 91.417 electronically in Simple Aircraft Manager, and how entries are signed electronically under 14 CFR 43.9 and 43.11. They follow FAA AC 120-78B. Under its paragraph 1.9.5, use of electronic signatures and recordkeeping under part 91 (other than subpart K) needs no FAA approval, acceptance or authorization; the FAA recommends following the AC, and these procedures do.</p>
|
||||
<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">Aircraft</th><th>Serial number</th><th>Electronic records since</th><th>Earlier records</th></tr></thead>
|
||||
<tbody>
|
||||
<% aircraft.each do |a| %>
|
||||
<tr class="border-b border-slate-100"><td class="py-1"><%= a.tail_number %> <%= [ a.make, a.model ].compact_blank.join(" ") %></td><td><%= a.serial_number.presence || "—" %></td>
|
||||
<td><%= a.electronic_records_since || "not set" %></td><td>Paper logbooks<%= " (scans held as legacy records)" if a.documents.where(legacy_record: true).exists? %></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="<%= p_ %>">Records kept electronically: logbook entries (maintenance, preventive maintenance, inspections, alterations), inspection status and history, airworthiness directive compliance, component times and life limits, major repairs and alterations with their Form 337s, weight and balance, and supporting documents. Paper logbooks from before the date above remain the record for that period and are kept.</p>
|
||||
|
||||
<h2 class="<%= h2 %>">2. Regulatory compliance</h2>
|
||||
<p class="<%= p_ %>">Each logbook entry carries what 14 CFR 43.9 requires (description of the work, date, the name, certificate number and kind of certificate of the person approving return to service, and their signature) and, for inspections, what 43.11 requires (type and extent of inspection, aircraft time in service, and the airworthiness statement or discrepancy list). The app flags entries missing any of these. Records include the key elements of AC 120-78B 3.1.1: the event, when (date, and the signature's time), where (location), who, the signature, and the make, model and serial of the aircraft, engine, propeller and components. The status required by 91.417(a)(2) is produced by the maintenance status report. Records are made available under 91.417(c) and transferred under 91.419 as described in sections 9 and 10.</p>
|
||||
|
||||
<h2 class="<%= h2 %>">3. System description</h2>
|
||||
<ul class="<%= p_ %> list-disc pl-5">
|
||||
<li><strong>Software:</strong> Simple Aircraft Manager, version <%= info.revision %> (Ruby <%= RUBY_VERSION %>, Rails <%= Rails.version %>, SQLite <%= SQLite3::SQLITE_VERSION %>).</li>
|
||||
<li><strong>Hosting and network:</strong> <%= policy.hosting_description.presence || "[describe the server, location and network]" %> Access is over HTTPS<%= " with single sign-on (#{Sso.label})" if Sso.enabled? %>.</li>
|
||||
<li><strong>Data:</strong> one SQLite database plus uploaded files (stored once per identical file) on the server's storage volume.</li>
|
||||
<li><strong>Backups:</strong> every night the app makes a verified copy of the database in the storage volume (SQLite integrity check and record counts compared) and keeps the newest <%= Setting.integer("backups_kept") %>. Off-site: <%= policy.offsite_backup_description.presence || "[describe the off-site backup]" %></li>
|
||||
</ul>
|
||||
|
||||
<h2 class="<%= h2 %>">4. Responsible personnel</h2>
|
||||
<p class="<%= p_ %>"><%= policy.responsible_name.presence || "[Name]" %><%= ", #{policy.responsible_title}" if policy.responsible_title.present? %>, has authority and overall responsibility for the electronic signature process and the recordkeeping system, for controlling access to it (accounts, roles, disabling accounts), and for the quality-control audits. Administrators: <%= users.select(&:admin?).reject(&:disabled?).map(&:display_name).to_sentence.presence || "none" %>.</p>
|
||||
|
||||
<h2 class="<%= h2 %>">5. Defined users and roles</h2>
|
||||
<p class="<%= p_ %>">Owners keep an aircraft's records; pilots can view them and record flights, squawks and preventive maintenance. A user may sign entries with a current certificate on their profile: mechanic certificates (A&P, IA, airframe, powerplant, repair station, repairman) for maintenance and inspection entries; a pilot certificate for preventive maintenance only. Disabled accounts can't sign in or sign.</p>
|
||||
<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">User</th><th>Roles</th><th>Certificates</th><th>May sign</th></tr></thead>
|
||||
<tbody>
|
||||
<% users.each do |u| %>
|
||||
<% current = u.certificates.reject(&:expired?) %>
|
||||
<tr class="border-b border-slate-100 align-top"><td class="py-1"><%= u.display_name %><div class="text-xs text-slate-500"><%= u.email_address %></div></td>
|
||||
<td class="text-xs"><%= [ ("Administrator" if u.admin?), *u.aircraft_roles.map { "#{_1.role.capitalize}, #{_1.aircraft.tail_number}" } ].compact.join("; ").presence || "—" %><%= " (DISABLED)" if u.disabled? %></td>
|
||||
<td class="text-xs"><%= u.certificates.map { "#{_1.short_label} #{_1.number}#{" exp. #{_1.expires_on}" if _1.expires_on}" }.join("; ").presence || "—" %></td>
|
||||
<td class="text-xs"><%= if u.disabled? || current.empty? then "No"
|
||||
elsif current.any?(&:mechanic?) then "Maintenance and inspection entries"
|
||||
else "Preventive maintenance entries" end %></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="<%= p_ %>">People outside these users (e.g. a mechanic who did the work) sign through a one-time email invitation from an owner, with their own account and certificate, for that entry only; or they sign on paper (section 11).</p>
|
||||
|
||||
<h2 class="<%= h2 %>">6. Electronic signature process</h2>
|
||||
<ol class="<%= p_ %> list-decimal pl-5">
|
||||
<li>The signer opens the entry and chooses Sign. The entry is shown in full exactly as it will be certified (AC 2.2.4).</li>
|
||||
<li>They choose one of their own current certificates. The statement they will certify is shown with it, under the heading “Certified by” (2.2.2): for maintenance, “I certify that the work described in this entry was performed in accordance with 14 CFR Part 43, and I approve it for return to service with respect to that work”; for inspections, the 43.11(a)(5) statement; for preventive maintenance by a pilot, the corresponding statement.</li>
|
||||
<li>They prove who they are again: their password, or signing in again with single sign-on within the last five minutes (2.2.6), and confirm that they are signing with intent to sign (2.1.2.4–5).</li>
|
||||
<li>The system records the signer, the certificate (kind and number), the statement, the time (UTC), how they authenticated, their network address and browser, a SHA-256 fingerprint of the entry's content and a readable copy of it, and a server seal (HMAC) over the signature record (2.1.2.6, 2.2.5). The signer is told on screen and by email (2.2.3).</li>
|
||||
<li>Once signed, the entry and its components can't be edited or deleted (2.1.2.7–8, 2.2.7). A correction is made as a new entry that, once signed, supersedes the original; the original and its signature are kept and marked superseded (2.2.8).</li>
|
||||
<li>When someone no longer needs access, the responsible person disables their account: they can no longer sign in or sign, and their past signatures stay valid (2.2.6.4).</li>
|
||||
</ol>
|
||||
<p class="<%= p_ %>">Signed records are archived in the database, its nightly verified copies and the off-site backup, and can be exported with their signatures (2.2.9).</p>
|
||||
|
||||
<h2 class="<%= h2 %>">7. Recordkeeping system controls</h2>
|
||||
<ul class="<%= p_ %> list-disc pl-5">
|
||||
<li><strong>Controlled access (3.2.1):</strong> personal accounts; roles per aircraft; sessions end after 30 days unused; rate-limited sign-in; changing an email or password needs the current password.</li>
|
||||
<li><strong>Record preservation (3.2.2):</strong> every change to a maintenance record is kept with who, when and what changed, in a hash chain per aircraft that can't be edited; signed entries are locked.</li>
|
||||
<li><strong>Confidential information (3.2.3):</strong> records are visible only to the aircraft's users, and to share links an owner creates (scoped and optionally expiring).</li>
|
||||
<li><strong>Data corruption (3.2.4):</strong> nightly, the history chains and every signature's seal and fingerprint are checked; administrators are emailed on any problem.</li>
|
||||
<li><strong>Outages (3.2.5):</strong> entries are made on paper and signed in ink during an outage (section 13); the database is restored from the latest verified copy or the off-site backup.</li>
|
||||
<li><strong>Software revision control (3.2.6):</strong> the software is updated by deploying a new version built from its source repository; each version and when it ran is recorded by the system. Before an update that changes how records are entered, displayed or accessed, the responsible person reviews it, and these procedures are revised if they're affected.</li>
|
||||
<li><strong>Backups (3.2.7):</strong> see section 3.</li>
|
||||
</ul>
|
||||
|
||||
<h2 class="<%= h2 %>">8. Quality control and auditing</h2>
|
||||
<p class="<%= p_ %>">Every <%= policy.audit_interval_months %> months the responsible person carries out and records an audit in the system (3.2.8.5). The app checks that the integrity check and backups are passing, the procedures are adopted, signatures are intact, and lists expired certificates and software versions since the last audit. The auditor restores the off-site backup somewhere separate and opens it, compares <%= policy.audit_sample_size %> randomly chosen entries with their work orders or source documents, reviews the users and roles (disabling accounts no longer needed), and confirms the paper logbooks are kept. Audit results are kept in the system.<%= " Last audit: #{AuditRun.latest.performed_at.to_date}." if AuditRun.latest %></p>
|
||||
|
||||
<h2 class="<%= h2 %>">9. Making records available to the FAA and NTSB</h2>
|
||||
<p class="<%= p_ %>">On request (14 CFR 91.417(c), 49 CFR 830), the responsible person provides the records package for the aircraft: every logbook entry as a PDF with its electronic signature, a signature register, the full change history, the maintenance status report and the data archive, with a README. Printed copies are produced the same way. Direct access to the system can be offered but isn't required (3.2.8.6).</p>
|
||||
|
||||
<h2 class="<%= h2 %>">10. Transfer of records</h2>
|
||||
<p class="<%= p_ %>"><strong>At sale (91.419, 3.2.8.12):</strong> the buyer receives the records package and the data archive, which another installation of the system can import, together with the paper logbooks. <strong>To another system (3.2.8.9):</strong> records are exported as the data archive and the records package; both systems run side by side until the transfer is checked.</p>
|
||||
|
||||
<h2 class="<%= h2 %>">11. Continuity</h2>
|
||||
<p class="<%= p_ %>"><strong>Legacy records (3.2.8.10):</strong> records before the dates in section 1 are the paper logbooks, which are kept; scans are held as legacy records for reference. <strong>Maintenance providers (3.2.8.11):</strong> a provider signs electronically through an invitation, or signs a printed entry in ink; the signed paper is kept with the logbooks and scanned into the system.</p>
|
||||
|
||||
<h2 class="<%= h2 %>">12. Changes to the system and these procedures</h2>
|
||||
<p class="<%= p_ %>">These procedures are revised when the system or its use changes. Each revision is numbered, dated and adopted in the system by an administrator; earlier revisions are kept. Under AC 120-78B 1.9.5 no submission to the FAA is required for part 91 operations (3.2.8.13).</p>
|
||||
|
||||
<h2 class="<%= h2 %>">13. User instructions and training</h2>
|
||||
<p class="<%= p_ %>">Every user who keeps or signs records reads these instructions (also in the system under “How electronic records work”) before signing (2.2.12, 3.2.9).</p>
|
||||
<div class="mt-2 rounded border border-slate-200 p-3"><%= render "help/records_content" %></div>
|
||||
|
||||
<% if policy.additional_procedures.present? %>
|
||||
<h2 class="<%= h2 %>">14. Additional procedures</h2>
|
||||
<div class="<%= p_ %> whitespace-pre-wrap"><%= policy.additional_procedures %></div>
|
||||
<% end %>
|
||||
|
||||
<h2 class="<%= h2 %>">Revision history</h2>
|
||||
<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 %>
|
||||
<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>
|
||||
</article>
|
||||
@@ -0,0 +1,51 @@
|
||||
<% content_for :title, "Recordkeeping procedures" %>
|
||||
<h1 class="mb-1 text-2xl font-bold">Recordkeeping procedures</h1>
|
||||
<p class="mb-5 max-w-3xl text-sm text-slate-600">The standalone procedures document AC 120-78B asks for (paragraphs 2.2.11 and 3.2.8): how signatures and records work here, who's responsible, who may sign, backups, audits, and how records are produced and transferred. It's generated from the system's setup; fill in what the app can't know, review the draft, and adopt it as a revision. Adopt a new revision whenever users, hosting or procedures change.</p>
|
||||
|
||||
<div class="grid gap-5 lg:grid-cols-2">
|
||||
<%= form_with model: @policy, url: admin_procedures_path, method: :patch, class: "card card-body space-y-4" do |f| %>
|
||||
<h2 class="card-title">Details</h2>
|
||||
<%= f.errors_summary %>
|
||||
<%= f.field :operator_name, label: "Owner / operator", placeholder: "Jane Pilot" %>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<%= f.field :responsible_name, label: "Responsible person", placeholder: "Jane Pilot" %>
|
||||
<%= f.field :responsible_title, label: "Their role", placeholder: "Owner" %>
|
||||
</div>
|
||||
<%= f.field :hosting_description, as: :textarea, rows: 2, label: "Hosting and network",
|
||||
placeholder: "Self-hosted on a server at the owner's home, behind a firewall and an authenticating proxy." %>
|
||||
<%= f.field :offsite_backup_description, as: :textarea, rows: 2, label: "Off-site backup",
|
||||
placeholder: "The storage volume is backed up nightly with restic to an encrypted off-site repository; retention 30 days." %>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<%= f.field :audit_interval_months, as: :number, min: 1, max: 24, label: "Audit every (months)" %>
|
||||
<%= f.field :audit_sample_size, as: :number, min: 1, max: 50, label: "Entries sampled per audit" %>
|
||||
</div>
|
||||
<%= f.field :additional_procedures, as: :textarea, rows: 3, label: "Additional procedures (optional)" %>
|
||||
<%= f.submit "Save" %>
|
||||
<% end %>
|
||||
|
||||
<div class="space-y-5">
|
||||
<section class="card card-body space-y-3">
|
||||
<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>
|
||||
<% else %>
|
||||
<p class="text-sm text-amber-800">No revision adopted yet.</p>
|
||||
<% end %>
|
||||
<p class="text-sm"><%= link_to "Preview the draft", draft_admin_procedures_path, class: "link", target: "_blank" %> (generated from the current setup).</p>
|
||||
<%= form_with url: adopt_admin_procedures_path, class: "flex flex-wrap items-end gap-2" do %>
|
||||
<div class="min-w-0 flex-1"><%= label_tag :summary, "What changed", class: "label" %><%= text_field_tag :summary, nil, class: "input", placeholder: current ? "e.g. new mechanic added" : "Initial issue" %></div>
|
||||
<%= submit_tag "Adopt as revision #{(current&.number || 0) + 1}", class: "btn-primary", disabled: !@policy.complete?,
|
||||
title: (@policy.complete? ? nil : "Fill in the operator, responsible person, hosting and off-site backup first") %>
|
||||
<% end %>
|
||||
</section>
|
||||
<section class="card">
|
||||
<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 %>
|
||||
</ul>
|
||||
<% else %><%= empty_state "None." %><% end %>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,7 +2,7 @@
|
||||
<section class="card max-w-3xl">
|
||||
<div class="card-header"><h2 class="card-title">Sign this entry</h2></div>
|
||||
<div class="card-body space-y-4">
|
||||
<p class="text-sm text-slate-600">Review the entry: your signature will cover exactly what's shown here, and it can't be changed afterwards. A mistake is fixed with a correction entry.</p>
|
||||
<p class="text-sm text-slate-600">Review the entry: your signature will cover exactly what's shown here, and it can't be changed afterwards. A mistake is fixed with a correction entry. <%= link_to "How signing works", records_help_path, class: "link", target: "_blank" %></p>
|
||||
<%= render "logbook_entries/content", entry: entry %>
|
||||
<% if @signing_error %>
|
||||
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200" role="alert"><%= @signing_error %></div>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<%# User instructions for electronic records (also an appendix of the procedures document). %>
|
||||
<div class="space-y-3 text-sm leading-relaxed">
|
||||
<h3 class="font-semibold">Writing an entry</h3>
|
||||
<p>On the aircraft's Logbook tab, choose <strong>+ New Entry</strong>. Give the date, the logbook (aircraft, engine, propeller), the airframe total time, and what was done; for an engine or propeller entry pick the component (its times fill in) and tick any sub-components. A template can start the wording. An entry isn't a signed record until it's signed.</p>
|
||||
<h3 class="font-semibold">Signing</h3>
|
||||
<ol class="list-decimal space-y-1 pl-5">
|
||||
<li>Add your certificate (kind and number) once, on your profile.</li>
|
||||
<li>Open the entry and choose <strong>Sign</strong>. Read the entry as shown: your signature covers exactly that.</li>
|
||||
<li>Pick the certificate you're signing with. The statement you'll certify is shown with it (return to service, or the inspection statement).</li>
|
||||
<li>Re-enter your password, or sign in again with single sign-on, tick the confirmation and choose <strong>Sign entry</strong>. You'll see a confirmation and get an email.</li>
|
||||
</ol>
|
||||
<p>Never share your password or let someone else sign while you're signed in: a signature is yours alone. If you think someone has, tell the administrator straight away.</p>
|
||||
<h3 class="font-semibold">Mistakes</h3>
|
||||
<p>A signed entry can't be edited or deleted. Open it and choose <strong>Correct this entry</strong>: a new entry starts from the original; fix it, save, and sign it. The original stays, marked “Superseded by a correction”.</p>
|
||||
<h3 class="font-semibold">Someone else did the work</h3>
|
||||
<p>The owner can choose <strong>Ask someone to sign</strong> on the entry: the mechanic gets a one-time email link, signs in or creates their own account, adds their certificate and signs. If they prefer paper, print the entry (<strong>Print for logbook</strong>), have it signed in ink, and keep the paper with the logbooks (scan it into Documents).</p>
|
||||
<h3 class="font-semibold">Checking a record</h3>
|
||||
<p>A signed entry shows who certified it, with which certificate, when (UTC), what they certified, and its status. <strong>Valid</strong> means nothing has changed since signing. The fingerprint (a SHA-256 of the entry) is printed on paper copies so a copy can be matched to the record. Every change to any record is kept under <strong>Activity → Record history</strong>.</p>
|
||||
<h3 class="font-semibold">If the system is down</h3>
|
||||
<p>Make the entry on paper and sign it in ink. When the system is back, add the entry and scan the signed paper into Documents; the paper itself stays with the logbooks and remains the signed record for that entry.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<% content_for :title, "How electronic records work" %>
|
||||
<section class="card card-body max-w-3xl">
|
||||
<h1 class="text-2xl font-bold">How electronic records work</h1>
|
||||
<p class="mb-4 mt-1 text-sm text-slate-600">Instructions for everyone who keeps or signs maintenance records here.</p>
|
||||
<%= render "help/records_content" %>
|
||||
</section>
|
||||
@@ -37,7 +37,7 @@
|
||||
<%= link_to "Profile", edit_profile_path, class: "block px-4 py-2.5 hover:bg-slate-100" %>
|
||||
<% if current_user.admin? %>
|
||||
<p class="border-t border-slate-100 px-4 pt-2 pb-1 text-xs font-semibold text-slate-500">Admin</p>
|
||||
<% [ [ "Users", admin_users_path ], [ "Component Types", admin_component_types_path ], [ "Airports", admin_airports_path ], [ "Logbook Templates", admin_logbook_templates_path ], [ "Settings", edit_admin_settings_path ], [ "About", admin_about_path ] ].each do |label, path| %>
|
||||
<% [ [ "Users", admin_users_path ], [ "Component Types", admin_component_types_path ], [ "Airports", admin_airports_path ], [ "Logbook Templates", admin_logbook_templates_path ], [ "Settings", edit_admin_settings_path ], [ "Recordkeeping Procedures", admin_procedures_path ], [ "Records Audits", admin_audits_path ], [ "About", admin_about_path ] ].each do |label, path| %>
|
||||
<%= link_to label, path, class: "block px-4 py-2.5 hover:bg-slate-100" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -53,7 +53,7 @@
|
||||
Admin <span aria-hidden="true" class="text-xs">▾</span>
|
||||
</summary>
|
||||
<div class="absolute right-0 z-30 mt-2 w-48 rounded-md bg-surface py-1 text-slate-700 shadow-lg ring-1 ring-slate-200">
|
||||
<% [ [ "Users", admin_users_path ], [ "Component Types", admin_component_types_path ], [ "Airports", admin_airports_path ], [ "Logbook Templates", admin_logbook_templates_path ], [ "Settings", edit_admin_settings_path ], [ "About", admin_about_path ] ].each do |label, path| %>
|
||||
<% [ [ "Users", admin_users_path ], [ "Component Types", admin_component_types_path ], [ "Airports", admin_airports_path ], [ "Logbook Templates", admin_logbook_templates_path ], [ "Settings", edit_admin_settings_path ], [ "Recordkeeping Procedures", admin_procedures_path ], [ "Records Audits", admin_audits_path ], [ "About", admin_about_path ] ].each do |label, path| %>
|
||||
<%= link_to label, path, class: [ "block px-4 py-2 text-sm hover:bg-slate-100", ("font-semibold text-sky-700" if current_page?(path)) ] %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Maintenance Logbook</h2>
|
||||
<h2 class="card-title">Maintenance Logbook <%= link_to "How records and signing work", records_help_path, class: "link ml-2 text-xs font-normal" %></h2>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<%= form_with url: aircraft_logbook_entries_path(@aircraft), method: :get, class: "flex w-full flex-wrap gap-2 sm:w-auto" do |f| %>
|
||||
<%= f.search_field :q, value: @query, placeholder: "Search entries…", class: "input min-w-0 flex-1 sm:w-48 sm:flex-none" %>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<% @certificates.each do |c| %><li><strong><%= c.expired? ? "Expired" : "Expires" %> <%= c.expires_on %>:</strong> <%= c.kind_label %> <%= c.number %></li><% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if @audit_due %><p><strong>Records audit due <%= @audit_due %></strong> (AC 120-78B quality control): <%= link_to "start it", new_admin_audit_url %>.</p><% end %>
|
||||
<p style="color: #64748b; font-size: 12px; margin-top: 20px;">
|
||||
Based on the records in Simple Aircraft Manager. Turn these emails off on your <%= link_to "profile", edit_profile_url %>.
|
||||
</p>
|
||||
@@ -16,5 +16,9 @@ Your certificates:
|
||||
- <%= c.expired? ? "Expired" : "Expires" %> <%= c.expires_on %>: <%= c.kind_label %> <%= c.number %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @audit_due %>
|
||||
|
||||
Records audit due <%= @audit_due %>: <%= new_admin_audit_url %>
|
||||
<% end %>
|
||||
|
||||
Based on the records in Simple Aircraft Manager. Turn these emails off on your profile: <%= edit_profile_url %>
|
||||
Reference in new issue
Block a user