dawarich/app/views/stats/_stat.html.erb

31 lines
1.1 KiB
Text
Raw Normal View History

2024-03-23 15:29:55 -04:00
<div id="<%= dom_id stat %>" class="card w-full bg-base-200 shadow-xl">
<div class="card-body">
<div class="flex justify-between items-center">
<h2 class="card-title">
<%= link_to map_url(timespan(stat.month, stat.year)), class: "underline hover:no-underline text-#{header_colors.sample}" do %>
<%= Date::MONTHNAMES[stat.month] %>
<% end %>
</h2>
<div class="flex items-center gap-2">
<%= link_to '[Update]', update_year_month_stats_path(stat.year, stat.month), data: { turbo_method: :put }, class: 'text-sm text-gray-500 hover:underline' %>
</div>
</div>
2024-08-28 17:54:00 -04:00
<p><%= stat.distance %><%= DISTANCE_UNIT %></p>
<% if REVERSE_GEOCODING_ENABLED %>
<div class="card-actions justify-end">
<%= countries_and_cities_stat_for_month(stat) %>
</div>
<% end %>
<% if stat.daily_distance %>
<%= column_chart(
stat.daily_distance,
height: '100px',
2024-08-28 17:54:00 -04:00
suffix: " #{DISTANCE_UNIT}",
xtitle: 'Days',
ytitle: 'Distance'
) %>
<% end %>
2024-03-23 15:29:55 -04:00
</div>
</div>