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
@@ -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>
|
||||
Reference in new issue
Block a user