From 3da2173b3a2df0bb191be9c7fa03680685f80a0b Mon Sep 17 00:00:00 2001 From: Christoph Marzell Date: Sun, 8 Feb 2026 08:56:42 +0100 Subject: [PATCH] fix display --- app/views/entries/monthly_report.html.erb | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app/views/entries/monthly_report.html.erb b/app/views/entries/monthly_report.html.erb index aad845b..6ce6efa 100644 --- a/app/views/entries/monthly_report.html.erb +++ b/app/views/entries/monthly_report.html.erb @@ -1,9 +1,11 @@ -

📆 Monats-Report

- <% @report.each do |month, groups| %> <% is_current_month = month.month == Date.today.month && month.year == Date.today.year %> -
+ <% total_minutes = groups.values.map { |data| (data[:hours].to_i * 60 + data[:minutes].to_i) }.sum %> + <% total_hours = total_minutes / 60 %> + <% total_rest_minutes = total_minutes % 60 %> + +
<%= month.strftime("%B %Y") %> <% if is_current_month %> @@ -13,20 +15,27 @@
- +
- - - + + + + - <% groups.each do |(typ, art), data| %> + <% groups.each_with_index do |((typ, art), data), index| %> + + <% if index == 0 %> + + <% end %> <% end %> @@ -34,5 +43,4 @@ - <% end %>
📌 Typ📂 Art⏱️ Gesamtzeit📌 Typ📂 Art⏱️ Zeit🧮 Monats-Gesamt
<%= typ.capitalize %> <%= art %> <%= data[:hours] %>h <%= data[:minutes] %>min + <%= total_hours %>h <%= total_rest_minutes %>min +