mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Procedures: hosting and additional procedures render as Markdown (paragraphs, bold)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f2e4fd0beb
commit
90e68711a0
3 files changed
+14
-4
No files matched your search
@@ -32,7 +32,9 @@
|
||||
<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>Hosting and network:</strong>
|
||||
<% if policy.hosting_description.present? %><div class="mt-1"><%= markdown(policy.hosting_description) %></div><% else %>[describe the server, location and network]<% end %>
|
||||
<p class="mt-1">Access is over HTTPS<%= " with single sign-on (#{Sso.label})" if Sso.enabled? %>.</p></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: <% if OffsiteConnection.connected? %>after each nightly backup the app copies the verified database snapshot (compressed) to Google Drive (account <%= OffsiteConnection.current.account_email %>, folder “<%= OffsiteConnection::ROOT_FOLDER %>”), keeping the newest <%= Setting.integer("offsite_backups_kept") %>, together with every uploaded file (scans, documents, attachments) not already copied; files are never deleted from the off-site copy. A failed copy is emailed to the administrators. A restore test downloads the newest copy, opens it and checks it, and checks a sample of files against their checksums.<%= " #{policy.offsite_backup_description}" if policy.offsite_backup_description.present? %><% else %><%= policy.offsite_backup_description.presence || "[describe the off-site backup]" %><% end %></li>
|
||||
</ul>
|
||||
@@ -101,7 +103,7 @@
|
||||
|
||||
<% if policy.additional_procedures.present? %>
|
||||
<h2 class="<%= h2 %>">14. Additional procedures</h2>
|
||||
<div class="<%= p_ %> whitespace-pre-wrap"><%= policy.additional_procedures %></div>
|
||||
<div class="<%= p_ %>"><%= markdown(policy.additional_procedures) %></div>
|
||||
<% end %>
|
||||
|
||||
<h2 class="<%= h2 %>">Revision history</h2>
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
<%= 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",
|
||||
<%= f.field :hosting_description, as: :textarea, rows: 8, label: "Hosting and network",
|
||||
hint: "Leave a blank line between paragraphs. Markdown works: **bold**, lists.",
|
||||
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: (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."),
|
||||
@@ -20,7 +21,8 @@
|
||||
<%= 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.field :additional_procedures, as: :textarea, rows: 12, label: "Additional procedures (optional)",
|
||||
hint: "Leave a blank line between items. Markdown works: **bold** headings, lists." %>
|
||||
<%= f.submit "Save" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ class RecordkeepingProceduresTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
assert_includes response.body, "Jane Pilot"
|
||||
assert_includes response.body, "Self-hosted server behind a firewall."
|
||||
RecordkeepingPolicy.current.update!(hosting_description: "First paragraph.\n\nSecond paragraph.", additional_procedures: "**Who makes entries.** The owner.\n\n**Retention.** Kept.")
|
||||
get draft_admin_procedures_path
|
||||
assert_select ".markdown p", text: "Second paragraph."
|
||||
assert_select ".markdown strong", text: "Retention."
|
||||
assert_no_match(/\*\*Retention/, response.body)
|
||||
fill_policy
|
||||
post adopt_admin_procedures_path, params: { summary: "Initial issue" }
|
||||
r1 = ProceduresRevision.current
|
||||
assert_equal 1, r1.number
|
||||
|
||||
Reference in new issue
Block a user