add nice statistics

This commit is contained in:
2025-06-21 09:38:22 +02:00
parent 99b0aaa72e
commit e79626972f
43 changed files with 1359 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
<main>
<h1>Statistics Dashboard</h1>
<%= javascript_include_tag 'activity_heatmap', 'data-turbo-track': 'reload' %>
<!-- Activity Heatmap (full width) -->
<%= render partial: 'statistics/activity_heatmap', locals: { activity_by_day: @activity_by_day } %>
<!-- Widgets row: Top 5 Artists (left, half), Total Plays + Placeholder (right, stacked) -->
<div style="display: flex; flex-wrap: wrap; gap: 2em; justify-content: center; align-items: flex-start; max-width: 1200px; margin-left: auto; margin-right: auto;">
<!-- Top 5 Artists Widget -->
<%= render partial: 'statistics/top_artists', locals: { top_artists_all_time: @top_artists_all_time, top_artists_year: @top_artists_year, top_artists_upcoming: @top_artists_upcoming } %>
<!-- Right column: Total Plays + Placeholder stacked -->
<div style="display: flex; flex-direction: column; gap: 2em; flex: 1 1 220px; min-width: 220px; max-width: 320px; align-self: flex-start;">
<!-- Total Plays Widget -->
<%= render partial: 'statistics/total_plays', locals: { total_plays: @total_plays } %>
<!-- Placeholder Widget -->
<%= render partial: 'statistics/placeholder' %>
</div>
</div>
</main>