diff --git a/app/views/entries/index.html.erb b/app/views/entries/index.html.erb index 3d8c8b2..02ed869 100644 --- a/app/views/entries/index.html.erb +++ b/app/views/entries/index.html.erb @@ -1,138 +1,150 @@

Meine Einträge

-
📊 Fortschritt je Kombination
- -
- -<%= bar_chart @progress_chart_data, - donut: false, - height: "300px", - library: { - legend: { position: "bottom" }, + + + + +
+ +
+
+

📊 Übersicht je Kombination

+
+ + + + + + + + + + + + + + <% ["propädeutikum", "fachspezifikum"].each do |typ| %> + <% ["Praktikum", "Selbsterfahrung", "Supervision"].each do |art| %> + <% remaining = @remaining_minutes_matrix.dig(typ, art) %> + <% soll = current_user.required_hours_matrix.dig(typ, art) %> + <% weekly = current_user.weekly_target_matrix.dig(typ, art) %> + <% ende = @estimated_end_by_typ_art.dig(typ, art) %> + + <% if remaining.present? || soll.present? || weekly.present? %> + + + + + + + + + + <% end %> + <% end %> + <% end %> + +
TypArtVerbleibendSoll (h)WöchentlichVorauss. EndeFortschritt
<%= typ.capitalize %><%= art.capitalize %><%= remaining ? "#{remaining / 60} h #{remaining % 60} min" : "—" %><%= soll || "—" %> h<%= weekly || "—" %> h/Woche<%= ende.present? ? ende.strftime("%d.%m.%Y") : "—" %> + <% percent = @completion_percent_by_typ_art[[typ, art]] %> + <%= percent ? "#{percent} %" : "—" %> +
+
+
+
- tooltip: { - callbacks: { - label: %|function(context) { + +
+
+ <%= bar_chart @progress_chart_data, + donut: false, + height: "300px", + library: { + legend: { position: "bottom" }, + tooltip: { + callbacks: { + label: %|function(context) { return context.label + ": " + context.parsed + "%"; }| - } - } - - } %> - -
- -
-
- -
-
🚗 Fahrtkosten (Kilometergeld)
- <% @total_kilometer_costs_by_year.each do |year, sum| %> - <% rate = MileageRate.find_by(year: year)&.rate_per_km || 0.42 %> - <% km = rate > 0 ? (sum.to_f / rate).round(1) : "?" %> -

<%= year %>: - <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> - (<%= km %> km bei <%= number_to_currency(rate, unit: "€", separator: ",", delimiter: ".", precision: 2) %>/km) -

- <% end %> -
- - -
-
💶 Fortbildungskosten
- <% @fortbildungskosten_by_year.each do |year, sum| %> -

<%= year %>: - <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> -

- <% end %> + } + } + } %>
+
-
-
🧠 Selbsterfahrungskosten
- <% @selbsterfahrungskosten_by_year.each do |year, sum| %> -

<%= year %>: - <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> -

- <% end %> -
+ +
+
+
+
+
🚗 Fahrtkosten (Kilometergeld)
+ <% @total_kilometer_costs_by_year.each do |year, sum| %> + <% rate = MileageRate.find_by(year: year)&.rate_per_km || 0.42 %> + <% km = rate > 0 ? (sum.to_f / rate).round(1) : "?" %> +

<%= year %>: + <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> + (<%= km %> km bei <%= number_to_currency(rate, unit: "€", separator: ",", delimiter: ".", precision: 2) %>/km) +

+ <% end %> +
-
-
👨‍🏫 Supervision
- <% @selbstsupervision_by_year.each do |year, sum| %> -

<%= year %>: - <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> -

- <% end %> -
+
+
💶 Fortbildungskosten
+ <% @fortbildungskosten_by_year.each do |year, sum| %> +

<%= year %>: + <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> +

+ <% end %> +
-
-
📊 Gesamtkosten (Werbungskosten)
- <% @allekosten_by_year.each do |year, sum| %> -

<%= year %>: - <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> -

- <% end %> -
+
+
🧠 Selbsterfahrungskosten
+ <% @selbsterfahrungskosten_by_year.each do |year, sum| %> +

<%= year %>: + <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> +

+ <% end %> +
-
-
🕒 Gesamtzeit
-

Total: <%= @total_minutes / 60 %>h <%= @total_minutes % 60 %> min

-

Propädeutikum: <%= @total_minutes_praktikum_prop / 60 %>h <%= @total_minutes_praktikum_prop % 60 %> min

-

Fachspezifikum: <%= @total_minutes_praktikum_fach / 60 %>h <%= @total_minutes_praktikum_fach % 60 %> min

+
+
👨‍🏫 Supervision
+ <% @selbstsupervision_by_year.each do |year, sum| %> +

<%= year %>: + <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> +

+ <% end %> +
+
+
📊 Gesamtkosten (Werbungskosten)
+ <% @allekosten_by_year.each do |year, sum| %> +

<%= year %>: + <%= number_to_currency(sum, unit: "€", separator: ",", delimiter: ".", precision: 2) %> +

+ <% end %> +
+
+
🕒 Gesamtzeit
+

Total: <%= @total_minutes / 60 %>h <%= @total_minutes % 60 %> min

+

Propädeutikum: <%= @total_minutes_praktikum_prop / 60 %>h <%= @total_minutes_praktikum_prop % 60 %> min

+

Fachspezifikum: <%= @total_minutes_praktikum_fach / 60 %>h <%= @total_minutes_praktikum_fach % 60 %> min

+
+
-
- -
-

📊 Übersicht je Kombination

-
- - - - - - - - - - - - - - <% ["propädeutikum", "fachspezifikum"].each do |typ| %> - <% ["Praktikum", "Selbsterfahrung", "Supervision"].each do |art| %> - <% remaining = @remaining_minutes_matrix.dig(typ, art) %> - <% soll = current_user.required_hours_matrix.dig(typ, art) %> - <% weekly = current_user.weekly_target_matrix.dig(typ, art) %> - <% ende = @estimated_end_by_typ_art.dig(typ, art) %> - - <% if remaining.present? || soll.present? || weekly.present? %> - - - - - - - - - - <% end %> - <% end %> - <% end %> - -
TypArtVerbleibendSoll (h)WöchentlichVorauss. EndeFortschritt
<%= typ.capitalize %><%= art.capitalize %><%= remaining ? "#{remaining / 60} h #{remaining % 60} min" : "—" %><%= soll || "—" %> h<%= weekly || "—" %> h/Woche<%= ende.present? ? ende.strftime("%d.%m.%Y") : "—" %> - <% percent = @completion_percent_by_typ_art[[typ, art]] %> - <%= percent ? "#{percent} %" : "—" %> -
-
- -
-

⏱ Timer

<% if @running_entry.present? %>