<% content_for :title, "Recordkeeping procedures" %>

Recordkeeping procedures

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.

<%= form_with model: @policy, url: admin_procedures_path, method: :patch, class: "card card-body space-y-4" do |f| %>

Details

<%= f.errors_summary %> <%= f.field :operator_name, label: "Owner / operator", placeholder: "Jane Pilot" %>
<%= f.field :responsible_name, label: "Responsible person", placeholder: "Jane Pilot" %> <%= f.field :responsible_title, label: "Their role", placeholder: "Owner" %>
<%= f.field :hosting_description, as: :textarea, rows: 8, label: "Hosting and network", hint: "Leave a blank line between paragraphs. Markdown works: **bold**, lists.", data: { insert_text_target: "field" }, placeholder: "Where the server is, who can administer it, how it's reached and protected, how updates are installed." %>
<%= f.field :offsite_backup_description, as: :textarea, rows: 2, label: (OffsiteConnection.connected? ? "Off-site backup (optional: Google Drive is connected)" : "Off-site backup"), hint: (OffsiteConnection.connected? ? "The Google Drive backup is described automatically; add anything else here." : "Or set up the built-in Google Drive backup under Admin → Off-site Backup."), placeholder: "The storage volume is backed up nightly with restic to an encrypted off-site repository; retention 30 days." %>
<%= 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" %>
<%= f.field :additional_procedures, as: :textarea, rows: 12, label: "Additional procedures (optional)", hint: "Leave a blank line between items. Markdown works: **bold** headings, lists.", data: { insert_text_target: "field" } %>

Suggested text is filled in from this installation's settings, with [bracketed] blanks for what only you know. Edit it to match how you actually work, then save. A revision can't be adopted while a blank is left.

<%= f.submit "Save" %> <% end %>

Current revision

<% current = @revisions.first %> <% if current %>

Revision <%= current.number %>, 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" %>

<% else %>

No revision adopted yet.

<% end %>

<%= link_to "Preview the draft", draft_admin_procedures_path, class: "link", target: "_blank" %> (generated from the current setup).

<%= form_with url: adopt_admin_procedures_path, class: "flex flex-wrap items-end gap-2" do %>
<%= label_tag :summary, "What changed", class: "label" %><%= text_field_tag :summary, nil, class: "input", placeholder: current ? "e.g. new mechanic added" : "Initial issue" %>
<% if @policy.unfilled_fields.any? %>

Fill in the [bracketed] blanks in: <%= @policy.unfilled_fields.to_sentence %>.

<% end %> <%= 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 (or connect Google Drive) first") %> <% end %>

Earlier revisions

<% if @revisions.size > 1 %>
    <% @revisions.drop(1).each do |r| %>
  • Revision <%= r.number %> · <%= r.adopted_at.to_date %> · <%= r.summary %><%= link_to "View", revision_admin_procedures_path(r), class: "link", target: "_blank" %>
  • <% end %>
<% else %><%= empty_state "None." %><% end %>