mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Initial commit: Rails port of Simple Aircraft Manager
Rails 8.1 + SQLite rewrite of marbindrakon/simple-aircraft-manager, designed to self-host as a single container (Solid Queue/Cache/Cable, Active Storage on disk, Hotwire + importmap, Tailwind). - Airworthiness engine ported from health/services.py (ADs, grounding squawks, inspection recurrency, component replacement) - Hours updates and flight logs cascading to in-service components, optional airworthiness enforcement - Components, squawks, ADs, inspections, logbook, documents, major records, oil/fuel consumption stats and charts, activity log - Admin/owner/pilot RBAC and public share links (status/maintenance) - Docker Compose and Kamal deployment, env-driven production config - Service and integration tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
38df19c331
264 files changed
+8365
No files matched your search
@@ -0,0 +1,109 @@
|
||||
<% content_for :title, @aircraft.tail_number %>
|
||||
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
||||
|
||||
<div class="grid gap-5 lg:grid-cols-3">
|
||||
<div class="space-y-5 lg:col-span-2">
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Airworthiness</h2>
|
||||
<%= airworthiness_badge(@airworthiness, large: true) %>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<% if @airworthiness.issues.empty? %>
|
||||
<p class="text-sm text-emerald-700">No open issues. All tracked ADs, inspections, components and squawks are current.</p>
|
||||
<% else %>
|
||||
<ul class="divide-y divide-slate-100">
|
||||
<% @airworthiness.issues.each do |issue| %>
|
||||
<li class="flex items-start gap-3 py-2">
|
||||
<span class="<%= issue.severity == 'RED' ? 'badge-red' : 'badge-orange' %> mt-0.5"><%= issue.category %></span>
|
||||
<div>
|
||||
<div class="text-sm font-medium"><%= issue.title %></div>
|
||||
<div class="text-xs text-slate-500"><%= issue.description %></div>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if @aircraft.airworthiness_enforcement? %>
|
||||
<p class="hint mt-3">Airworthiness enforcement is on: flights and hours updates are blocked while the status is red.</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Active Squawks</h2>
|
||||
<%= link_to "All squawks →", aircraft_squawks_path(@aircraft), class: "link text-sm" %>
|
||||
</div>
|
||||
<% if @active_squawks.any? %>
|
||||
<%= render "squawks/table", squawks: @active_squawks, aircraft: @aircraft %>
|
||||
<% else %>
|
||||
<%= empty_state "No open squawks." %>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-header"><h2 class="card-title">Consumption</h2>
|
||||
<%= link_to "Oil & fuel →", aircraft_consumable_records_path(@aircraft), class: "link text-sm" %></div>
|
||||
<div class="card-body grid grid-cols-2 gap-4 text-center">
|
||||
<div><div class="text-2xl font-semibold"><%= @oil.average || "—" %></div><div class="text-xs text-slate-500">Avg oil, hrs/qt</div></div>
|
||||
<div><div class="text-2xl font-semibold"><%= @fuel.average || "—" %></div><div class="text-xs text-slate-500">Avg fuel burn, gal/hr</div></div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="space-y-5">
|
||||
<section class="card">
|
||||
<div class="card-header"><h2 class="card-title">Update Hours</h2></div>
|
||||
<%= form_with url: hours_aircraft_path(@aircraft), method: :patch, class: "card-body space-y-3" do |f| %>
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div><%= f.label :tach_time, "Tach", class: "label" %>
|
||||
<%= f.number_field :tach_time, value: @aircraft.tach_time, step: 0.1, class: "input", required: true %></div>
|
||||
<div><%= f.label :hobbs_time, "Hobbs", class: "label" %>
|
||||
<%= f.number_field :hobbs_time, value: @aircraft.hobbs_time, step: 0.1, class: "input" %></div>
|
||||
</div>
|
||||
<p class="hint">Enter the current meter readings. The difference is applied to every in-service component. For a single flight, use <%= link_to "Log Flight", new_aircraft_flight_log_path(@aircraft), class: "link" %>.</p>
|
||||
<%= f.submit "Update Hours", class: "btn-primary" %>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Details</h2>
|
||||
<% if owner? %><%= link_to "Edit", edit_aircraft_path(@aircraft), class: "btn-secondary btn-sm" %><% end %>
|
||||
</div>
|
||||
<dl class="card-body grid grid-cols-2 gap-x-3 gap-y-2 text-sm">
|
||||
<dt class="text-slate-500">Serial</dt><dd><%= @aircraft.serial_number.presence || "—" %></dd>
|
||||
<dt class="text-slate-500">Purchased</dt><dd><%= fmt_date(@aircraft.purchased) %></dd>
|
||||
<dt class="text-slate-500">Tach offset</dt><dd><%= hours(@aircraft.tach_time_offset) %></dd>
|
||||
<dt class="text-slate-500">Hobbs offset</dt><dd><%= hours(@aircraft.hobbs_time_offset) %></dd>
|
||||
</dl>
|
||||
<% if @aircraft.description.present? %>
|
||||
<p class="border-t border-slate-100 px-4 py-3 text-sm text-slate-600"><%= simple_format @aircraft.description %></p>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-header"><h2 class="card-title">Notes</h2>
|
||||
<%= link_to "+ Add", new_aircraft_note_path(@aircraft), class: "btn-secondary btn-sm" %></div>
|
||||
<% if @notes.any? %>
|
||||
<ul class="divide-y divide-slate-100">
|
||||
<% @notes.each do |note| %>
|
||||
<li class="px-4 py-2 text-sm">
|
||||
<div><%= note.text.truncate(200) %></div>
|
||||
<div class="text-xs text-slate-500"><%= note.user&.display_name %> · <%= time_ago_in_words(note.created_at) %> ago <%= "· public" if note.public? %></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<%= empty_state "No notes." %>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-header"><h2 class="card-title">Recent Activity</h2>
|
||||
<%= link_to "All →", aircraft_events_path(@aircraft), class: "link text-sm" %></div>
|
||||
<%= render "events/list", events: @recent_events %>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user