Files
simple-aircraft-manager-rails/app/views/reminder_mailer/weekly.html.erb
T
rickyandClaude Opus 5.5 aa262065b2 Certificates on user profiles, with "Sign as"
- Users add their FAA certificates (kind, number, optional expiry) on
  their profile; admins see them on the Users list
- "Sign as" on new/edited logbook entries and the squawk Resolve page
  fills the signer's name, kind of certificate and number (expired
  certificates aren't offered); deferrals default to mechanic for users
  with a mechanic certificate
- Weekly reminder lists certificates expiring within 60 days (or lapsed
  in the last 30), even when nothing else is due
- Preventive maintenance templates keep a certificate already chosen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:08:21 -05:00

24 lines
1.5 KiB
ERB

<p>Here's what needs attention<%= " on your aircraft" if @items.any? %>.</p>
<% @items.each do |aircraft, issues, alerts| %>
<h3 style="margin: 16px 0 4px;"><%= link_to aircraft.tail_number, aircraft_url(aircraft) %> <span style="font-weight: normal; color: #64748b;"><%= aircraft.airworthiness.label %></span></h3>
<ul style="margin: 0; padding-left: 20px;">
<% issues.each do |issue| %>
<li><strong><%= { "RED" => "Overdue", "LIMITED" => "Overdue", "ORANGE" => "Due soon", "INFO" => "Deferred" }[issue.severity] %>:</strong>
<%= issue.title %> <span style="color: #64748b;"><%= issue.description %></span></li>
<% end %>
</ul>
<% if alerts.any? %>
<p style="margin: 8px 0 0;"><strong><%= alerts.size %> newly published <%= "AD".pluralize(alerts.size) %> may apply:</strong>
<%= alerts.map { _1.ad_number || _1.fr_document_number }.to_sentence %>. <%= link_to "Review them", aircraft_airworthiness_directives_url(aircraft, anchor: "new-ads") %>.</p>
<% end %>
<% end %>
<% if @certificates.any? %>
<h3 style="margin: 16px 0 4px;">Your certificates</h3>
<ul style="margin: 0; padding-left: 20px;">
<% @certificates.each do |c| %><li><strong><%= c.expired? ? "Expired" : "Expires" %> <%= c.expires_on %>:</strong> <%= c.kind_label %> <%= c.number %></li><% end %>
</ul>
<% end %>
<p style="color: #64748b; font-size: 12px; margin-top: 20px;">
Based on the records in Simple Aircraft Manager. Turn these emails off on your <%= link_to "profile", edit_profile_url %>.
</p>