mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Add dark mode; align table headers with numeric columns
Dark mode: - Theme toggle in the header (System → Light → Dark); "System" follows the OS setting and its changes. The choice is kept per browser and applied before first paint, so there's no light flash. - Implemented by remapping the palette under :root[data-theme=dark]: grays flip, color tints become translucent, dark colored text becomes its light counterpart. Page, surface, header and accent colors are semantic tokens. Native controls follow via color-scheme. - Chart text and grid colors follow the theme. - Public share pages get the toggle too. - Contrast checked against WCAG 4.5:1 (primary button text and error text adjusted for dark). Tables: - Shared table style no longer forces header text left, so right-aligned numeric headers line up with their columns everywhere. - Flight log: units in headers, muted dashes for empty cells, GPS marker beside the route instead of its own column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5bf682502b
commit
86aadfcf6c
13 files changed
+216
-25
No files matched your search
@@ -6,18 +6,21 @@
|
||||
<% if @flight_logs.any? %>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<thead><tr><th>Date</th><th>Route</th><th class="text-right">Tach</th><th class="text-right">Hobbs</th><th class="text-right">Oil</th><th class="text-right">Fuel</th><th>Pilot</th><th></th></tr></thead>
|
||||
<thead><tr><th>Date</th><th>Route</th><th class="text-right">Tach</th><th class="text-right">Hobbs</th><th class="text-right">Oil (qt)</th><th class="text-right">Fuel (gal)</th><th class="pl-6">Pilot</th></tr></thead>
|
||||
<tbody>
|
||||
<% blank = tag.span("—", class: "text-slate-300") %>
|
||||
<% @flight_logs.each do |fl| %>
|
||||
<tr>
|
||||
<td class="whitespace-nowrap"><%= link_to fl.date, aircraft_flight_log_path(@aircraft, fl), class: "link" %></td>
|
||||
<td><%= fl.route_summary.presence || "—" %></td>
|
||||
<td class="text-right tabular-nums"><%= hours(fl.tach_time) %></td>
|
||||
<td class="text-right tabular-nums"><%= hours(fl.hobbs_time) %></td>
|
||||
<td class="text-right tabular-nums"><%= fl.oil_added ? "#{fl.oil_added} qt" : "" %></td>
|
||||
<td class="text-right tabular-nums"><%= fl.fuel_added ? "#{fl.fuel_added} gal" : "" %></td>
|
||||
<td class="text-xs"><%= fl.user&.display_name %></td>
|
||||
<td class="text-right"><%= "📍" if fl.track_log.attached? %></td>
|
||||
<td class="whitespace-nowrap">
|
||||
<%= fl.route_summary.presence || blank %>
|
||||
<% if fl.track_log.attached? %><span class="ml-1" title="GPS track attached" aria-label="GPS track attached">📍</span><% end %>
|
||||
</td>
|
||||
<td class="text-right tabular-nums"><%= fl.tach_time ? hours(fl.tach_time) : blank %></td>
|
||||
<td class="text-right tabular-nums"><%= fl.hobbs_time ? hours(fl.hobbs_time) : blank %></td>
|
||||
<td class="text-right tabular-nums"><%= fl.oil_added ? number_with_precision(fl.oil_added, precision: 2, strip_insignificant_zeros: true) : blank %></td>
|
||||
<td class="text-right tabular-nums"><%= fl.fuel_added ? number_with_precision(fl.fuel_added, precision: 2, strip_insignificant_zeros: true) : blank %></td>
|
||||
<td class="pl-6 text-slate-600"><%= fl.user&.display_name || blank %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in new issue
Block a user