%# Flying metrics. "Flight time" = Hobbs where recorded, else tach. %>
<% periods = stats.periods %>
<% [ [ t(".past_30_days"), periods[0] ], [ t(".this_year"), periods[2] ], [ t(".past_12_months"), periods[1] ], [ t(".since", first_date: (fmt_date(stats.first_date))), periods[4] ] ].each do |title, p| %>
<%= title %>
<%= hours(p.flight) %> <%= t(".hrs") %>
<%= t(".tach_gal_html", count: p.flights, tach: (hours(p.tach)), fuel: (number_with_delimiter(p.fuel))) %>
<% end %>
<%= column_chart stats.flight_hours_by_month, height: "220px", colors: [ "#0369a1" ], ytitle: "hrs", library: { plugins: { legend: { display: false } } } %>
- <%= t(".flights_logged") %>
- <%= number_with_delimiter(stats.count) %>
- <%= t(".flight_time") %>
- <%= t(".hrs_2_html", total_flight: (hours(stats.total_flight))) %>
- <%= t(".tach_time") %>
- <%= t(".hrs_3_html", total_tach: (hours(stats.total_tach))) %>
- <%= t(".average_flight") %>
- <%= t(".hrs_4_html", average_flight: (hours(stats.average_flight))) %>
- <%= t(".longest_flight") %>
- <%= t(".hrs_5_html", longest_flight: (hours(stats.longest_flight))) %>
- <%= t(".fuel") %>
- <%= t(".gal_html", total_fuel: (number_with_delimiter(stats.total_fuel))) %>
- <%= t(".fuel_burn") %>
- <%= t(".gal_hr_html", gph: (stats.gph || "—")) %>
- <%= t(".airports_visited") %>
- <%= stats.airports_visited %>
<% if stats.top_airports.any? %>
<%= t(".most_visited") %>
<%= stats.top_airports.map { |code, n| "#{code} (#{n})" }.join(" · ") %>
<% end %>
<% if stats.by_year.size > 1 %>