|
|
|
@ -1,9 +1,11 @@ |
|
|
|
<h1 class="mb-4 display-6">📆 Monats-Report</h1> |
|
|
|
|
|
|
|
<% @report.each do |month, groups| %> |
|
|
|
<% is_current_month = month.month == Date.today.month && month.year == Date.today.year %> |
|
|
|
|
|
|
|
<div class="card shadow-sm mb-4 overflow-hidden <%= 'bg-light border-primary' if is_current_month %>" style="border-radius: .75rem;"> |
|
|
|
<% 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 %> |
|
|
|
|
|
|
|
<div class="card shadow-sm mb-4 overflow-hidden <%= 'bg-light border-primary' if is_current_month %>" style="border-radius: 0.75rem;"> |
|
|
|
<div class="card-header d-flex justify-content-between align-items-center bg-white" style="border-bottom: 1px solid #dee2e6;"> |
|
|
|
<strong><%= month.strftime("%B %Y") %></strong> |
|
|
|
<% if is_current_month %> |
|
|
|
@ -13,20 +15,27 @@ |
|
|
|
|
|
|
|
<div class="card-body p-0"> |
|
|
|
<div class="table-responsive"> |
|
|
|
<table class="table table-hover table-bordered mb-0 text-center align-middle" style="border-radius: 0 !important;"> |
|
|
|
<table class="table table-bordered table-hover mb-0 text-center align-middle" style="margin-bottom: 0; border-radius: 0 !important;"> |
|
|
|
<thead class="table-light"> |
|
|
|
<tr> |
|
|
|
<th style="width: 33%">📌 Typ</th> |
|
|
|
<th style="width: 33%">📂 Art</th> |
|
|
|
<th style="width: 33%">⏱️ Gesamtzeit</th> |
|
|
|
<th style="width: 25%">📌 Typ</th> |
|
|
|
<th style="width: 25%">📂 Art</th> |
|
|
|
<th style="width: 25%">⏱️ Zeit</th> |
|
|
|
<th style="width: 25%">🧮 Monats-Gesamt</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<% groups.each do |(typ, art), data| %> |
|
|
|
<% groups.each_with_index do |((typ, art), data), index| %> |
|
|
|
<tr> |
|
|
|
<td><%= typ.capitalize %></td> |
|
|
|
<td><%= art %></td> |
|
|
|
<td><%= data[:hours] %>h <%= data[:minutes] %>min</td> |
|
|
|
|
|
|
|
<% if index == 0 %> |
|
|
|
<td rowspan="<%= groups.size %>" class="align-middle bg-light text-dark fw-bold"> |
|
|
|
<span class="d-block"><%= total_hours %>h <%= total_rest_minutes %>min</span> |
|
|
|
</td> |
|
|
|
<% end %> |
|
|
|
</tr> |
|
|
|
<% end %> |
|
|
|
</tbody> |
|
|
|
@ -34,5 +43,4 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<% end %> |