Files
simple-aircraft-manager-rails/app/views/admin/settings/edit.html.erb
T
rickyandClaude Opus 5.5 9a20c91f5e Owners can invite mechanics again; who adds aircraft is an admin setting
- Admin → Settings → Who can add aircraft: administrators only (the
  default) or everyone. Adding an aircraft or importing a .sam.zip makes
  you its Owner, so this decides who can become one.
- A signing invitation from an Owner of the aircraft (or an
  administrator) lets the outside mechanic create an account for the
  invited address again, with a password or by signing in with SSO;
  checked when it's used. Others' signing invitations still need an
  existing account, and say so.
- Docs: who makes accounts, the new setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:09:49 -05:00

59 lines
3.5 KiB
ERB

<% content_for :title, t(".settings") %>
<h1 class="mb-4 text-2xl font-bold"><%= t(".settings") %></h1>
<%= form_with url: admin_settings_path, method: :patch, class: "card card-body max-w-xl space-y-4" do |f| %>
<% if @errors.present? %>
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200" role="alert">
<ul class="list-disc pl-5"><% @errors.each do |e| %><li><%= e %></li><% end %></ul>
</div>
<% end %>
<h2 class="card-title"><%= t(".uploads") %></h2>
<% upload = Setting::INTEGERS["max_upload_mb"] %>
<div>
<%= label_tag "settings[max_upload_mb]", Setting::LABELS["max_upload_mb"], class: "label" %>
<%= number_field_tag "settings[max_upload_mb]", @values["max_upload_mb"], id: "settings_max_upload_mb",
min: upload[:in].min, max: upload[:in].max, step: 1, required: true, class: "input w-32" %>
<p class="hint">
<%= t(".the_largest_single_file_anyone_html", default_mb: (upload[:default]), max: (upload[:in].max)) %>
</p>
<p class="hint">
<%= t(".a_proxy_in_front_of_html") %>
<%= t(".logbook_transcription_with_claude_reads_html", pdf_mb: (LogbookTranscriber::MAX_PDF_BYTES / 1.megabyte), image_mb: (LogbookTranscriber::MAX_IMAGE_BYTES / 1.megabyte)) %>
</p>
</div>
<h2 class="card-title pt-2"><%= t(".backups") %></h2>
<% kept = Setting::INTEGERS["backups_kept"] %>
<div>
<%= label_tag "settings[backups_kept]", Setting::LABELS["backups_kept"], class: "label" %>
<%= number_field_tag "settings[backups_kept]", @values["backups_kept"], id: "settings_backups_kept", min: kept[:in].min, max: kept[:in].max,
step: 1, required: true, class: "input w-32" %>
<p class="hint"><%= t(".a_verified_copy_of_the_html", link: (link_to t(".off_site_backup"), admin_offsite_backup_path, class: "link")) %></p>
</div>
<% okept = Setting::INTEGERS["offsite_backups_kept"] %>
<div>
<%= label_tag "settings[offsite_backups_kept]", Setting::LABELS["offsite_backups_kept"], class: "label" %>
<%= number_field_tag "settings[offsite_backups_kept]", @values["offsite_backups_kept"], id: "settings_offsite_backups_kept", min: okept[:in].min, max: okept[:in].max,
step: 1, required: true, class: "input w-32" %>
<p class="hint"><%= t(".with_off_site_backup_to") %></p>
</div>
<h2 class="card-title pt-2"><%= t(".aircraft") %></h2>
<div>
<%= label_tag "settings[anyone_adds_aircraft]", t(".who_can_add_aircraft"), class: "label" %>
<%= select_tag "settings[anyone_adds_aircraft]", options_for_select([ [ t(".administrators_only"), 0 ], [ t(".everyone"), 1 ] ], @values["anyone_adds_aircraft"].to_i),
id: "settings_anyone_adds_aircraft", class: "input" %>
<p class="hint"><%= t(".who_can_add_aircraft_hint") %></p>
</div>
<h2 class="card-title pt-2"><%= t(".document_search") %></h2>
<div>
<%= label_tag "settings[documents_claude_text]", t(".read_scanned_documents_with"), class: "label" %>
<%= select_tag "settings[documents_claude_text]", options_for_select([ [ t(".tesseract_free_on_this_server"), 0 ], [ t(".claude_better_on_handwriting_uses"), 1 ] ], @values["documents_claude_text"].to_i),
id: "settings_documents_claude_text", class: "input" %>
<p class="hint"><%= t(".text_in_documents_is_read_html", blank: (t(".it_isn_t") if ENV["ANTHROPIC_API_KEY"].blank?)) %></p>
</div>
<div class="flex gap-2"><%= f.submit t(".save_settings"), class: "btn-primary" %><%= link_to t(".cancel"), admin_about_path, class: "btn-secondary" %></div>
<% end %>