mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
- Admin -> Settings: maximum upload size per file (1-1024 MB, default 50), stored in a new settings table and read on each use, so a change applies to every process at once - Enforced by attachment validation and the direct-upload endpoint; upload forms, bulk upload and Admin -> About show the current limit - .sam.zip import accepts files up to 1 GB to match Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.5 KiB
ERB
25 lines
1.5 KiB
ERB
<%= form_with model: [aircraft, squawk], multipart: true, class: "card card-body space-y-4 max-w-2xl" do |f| %>
|
|
<%= f.errors_summary %>
|
|
<%= f.field :priority, as: :select, collection: Squawk::PRIORITIES.invert, hint: "“Ground Aircraft” makes the aircraft not airworthy until resolved." %>
|
|
<%= f.field :issue_reported, as: :textarea, label: "Issue", required: true, autofocus: true %>
|
|
<%= f.field :component_id, as: :select, label: "Component (optional)", collection: component_options(aircraft) %>
|
|
<%= f.field :attachments, as: :file, multiple: true, label: squawk.attachments.attached? ? "Add photos / files" : "Photos / files",
|
|
hint: "Select several at once. Images, PDFs or text, up to #{Setting.max_upload_mb} MB each." %>
|
|
<% if squawk.persisted? && squawk.attachments.attached? %>
|
|
<div>
|
|
<p class="label">Remove attached files</p>
|
|
<% squawk.attachments.each do |file| %>
|
|
<label class="flex items-center gap-2 text-sm"><%= check_box_tag "remove_attachment_ids[]", file.id, false, id: "remove_attachment_#{file.id}" %> <%= file.filename %></label>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% if squawk.persisted? %><%= f.field :notes, as: :textarea, rows: 3 %><% end %>
|
|
<div class="flex gap-2">
|
|
<%= f.submit squawk.new_record? ? "Report Squawk" : "Save" %>
|
|
<%= link_to "Cancel", aircraft_squawks_path(aircraft), class: "btn-secondary" %>
|
|
</div>
|
|
<% end %>
|
|
<% if squawk.persisted? && owner? %>
|
|
<div class="mt-4"><%= delete_button "Delete squawk", aircraft_squawk_path(aircraft, squawk) %></div>
|
|
<% end %>
|