<%= number_with_delimiter(current_user.total_km) %> km
Total distance
<%= number_with_delimiter current_user.points.count %>
Geopoints tracked
<% if REVERSE_GEOCODING_ENABLED %>
<%= number_with_delimiter current_user.total_reverse_geocoded %>
Reverse geocoded points
<%= number_with_delimiter current_user.total_countries %>
Countries visited
<%= current_user.total_cities %>
Cities visited
<% end %>
<%= link_to 'Update stats', stats_path, data: { 'turbo-method' => :post }, class: 'btn btn-primary mt-5' %>
<% @stats.each do |year, stats| %>

<%= link_to year, "/stats/#{year}", class: 'underline hover:no-underline' %> <%= link_to '[Map]', points_url(year_timespan(year)), class: 'underline hover:no-underline' %>

<% cache [current_user, 'year_distance_stat_in_km', year], skip_digest: true do %> <%= number_with_delimiter year_distance_stat_in_km(year) %>km <% end %>

<% if REVERSE_GEOCODING_ENABLED %>
<% cache [current_user, 'countries_and_cities_stat', year], skip_digest: true do %> <%= countries_and_cities_stat(year) %> <% end %>
<% end %> <%= column_chart( Stat.year_distance(year), height: '200px', suffix: ' km', xtitle: 'Days', ytitle: 'Distance' ) %>
<% end %>