You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.7 KiB
49 lines
1.7 KiB
<h1 class="mb-4">📊 Dashboard</h1>
|
|
|
|
<!-- Kacheln -->
|
|
<div class="row g-4 mb-4">
|
|
<%= render partial: 'dashboards/summary_tiles' %>
|
|
</div>
|
|
<div class="card shadow-sm mb-4">
|
|
<div class="card-body">
|
|
<h5 class="card-title">🎯 Fortschritt je Kombination</h5>
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered align-middle text-center">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Typ</th>
|
|
<th>Art</th>
|
|
<th>Geleistet</th>
|
|
<th>Ziel</th>
|
|
<th>Fortschritt</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% User::PRAKTIKUMSTYPEN.each do |typ| %>
|
|
<% User::ENTRY_ARTEN.each do |art| %>
|
|
<% spent = @spent_minutes_matrix.dig(typ, art).to_i %>
|
|
<% target = current_user.required_hours_matrix.dig(typ, art).to_i * 60 %>
|
|
<% percent = target > 0 ? ((spent.to_f / target) * 100).round : 0 %>
|
|
|
|
<tr>
|
|
<td><%= typ.capitalize %></td>
|
|
<td><%= art.capitalize %></td>
|
|
<td><%= spent / 60 %>h <%= spent % 60 %>min</td>
|
|
<td><%= target / 60 %>h</td>
|
|
<td>
|
|
<div class="progress" style="height: 20px;">
|
|
<div class="progress-bar <%= percent >= 100 ? 'bg-success' : 'bg-primary' %>" role="progressbar"
|
|
style="width: <%= [percent, 100].min %>%;" aria-valuenow="<%= percent %>"
|
|
aria-valuemin="0" aria-valuemax="100">
|
|
<%= percent %>%
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|