mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
- Overview: "Coming due" (next 30 days or 10 hours) and "Last flight" (the most recent day's legs, meters at the end, fuel and oil left). - Component replace / TBO / inspect intervals, inspection types and ADs take a number and a days / months / years choice (CalendarInterval). Components gain month columns (years stored as 12 months; months land on the same date); inspection types and ADs keep end-of-month. ADs now honour days. - Due list: hours already run out count as overdue; a component covered by an inspection type no longer gets its own "Inspect every" item. - Loading calculator moved to a partial; no limit warnings until a load is entered. Header buttons don't wrap on phones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1.1 KiB
ERB
23 lines
1.1 KiB
ERB
<%# What's due in the next few weeks or hours (Overview). %>
|
|
<section class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title">Coming due</h2>
|
|
<span class="text-xs text-slate-500">next <%= DueList::SOON_DAYS %> days or <%= DueList::SOON_HOURS %> hrs</span>
|
|
</div>
|
|
<% if due.any? %>
|
|
<ul class="divide-y divide-slate-100">
|
|
<% due.each do |item| %>
|
|
<li class="flex items-baseline justify-between gap-3 px-4 py-2 text-sm">
|
|
<%= link_to item.title, item.path, class: [ "hover:underline", ("font-medium text-red-700" if item.overdue?) ] %>
|
|
<span class="shrink-0 text-right text-xs text-slate-500 tabular-nums">
|
|
<% if item.overdue? %>overdue<% else %><%= "~" if item.projected %><%= fmt_date(item.date) %><% end %><%= " · at #{hours(item.due_hours)} hrs" if item.due_hours %>
|
|
</span>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% if due.any?(&:projected) %><p class="hint px-4 pb-3">"~" dates are estimated from the last year's flying.</p><% end %>
|
|
<% else %>
|
|
<%= empty_state "Nothing coming due soon." %>
|
|
<% end %>
|
|
</section>
|