From e1703ca87f04a1d9dbd1efa12835c9713d7c86e8 Mon Sep 17 00:00:00 2001 From: Christoph Marzell Date: Thu, 13 Nov 2025 09:12:20 +0100 Subject: [PATCH] minor ui fixes --- app/views/entries/index.html.erb | 354 +++++++++++++++---------------- 1 file changed, 176 insertions(+), 178 deletions(-) diff --git a/app/views/entries/index.html.erb b/app/views/entries/index.html.erb index eea5424..9a17d14 100644 --- a/app/views/entries/index.html.erb +++ b/app/views/entries/index.html.erb @@ -1,218 +1,216 @@ - -

Meine Einträge

- - -
-
- -
-
🚗 Fahrtkosten (Kilometergeld)
- <% @total_kilometer_costs_by_year.each do |year, sum| %> -

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

- <% end %> -
+

Meine Einträge

+ + +
+
+ +
+
🚗 Fahrtkosten (Kilometergeld)
+ <% @total_kilometer_costs_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 %> -
- -
-
🧠 Selbsterfahrungskosten
- <% @selbsterfahrungskosten_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 %> +
-
-
👨‍🏫 Supervision
- <% @selbstsupervision_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 %> +
-
-
📊 Gesamtkosten
- <% @allekosten_by_year.each do |year, sum| %> -

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

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

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

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

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

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

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

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

<%= @total_minutes / 60 %> h <%= @total_minutes % 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 %> + +
+

📊 Übersicht je Kombination

+
+
TypArtVerbleibendSoll (h)WöchentlichVorauss. Ende
<%= typ.capitalize %><%= art.capitalize %><%= remaining ? "#{remaining / 60} h #{remaining % 60} min" : "—" %><%= soll || "—" %> h<%= weekly || "—" %> h/Woche<%= ende.present? ? ende.strftime("%d.%m.%Y") : "—" %>
+ + + + + + + + + + + + <% ["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 %> - -
TypArtVerbleibendSoll (h)WöchentlichVorauss. Ende
<%= typ.capitalize %><%= art.capitalize %><%= remaining ? "#{remaining / 60} h #{remaining % 60} min" : "—" %><%= soll || "—" %> h<%= weekly || "—" %> h/Woche<%= ende.present? ? ende.strftime("%d.%m.%Y") : "—" %>
-
- - - -
-

⏱ Timer

- <% if @running_entry.present? %> -
-
- Laufender Eintrag: - <%= @running_entry.praktikums_typ %> – <%= @running_entry.entry_art %>
- Gestartet: <%= l(@running_entry.start_time, format: :short) %>
- Dauer: Berechne … -
-
- <%= button_to '⏹️ Stoppen', stop_timer_entry_path(@running_entry), method: :post, class: "btn btn-danger" %> -
-
<% end %> + + +
-
- +
- <%= form_with url: start_timer_entries_path, method: :post, local: true do %> -
-
- <%= label_tag :typ, 'Typ' %> - <%= select_tag :typ, options_for_select(Entry::PRAKTIKUMSTYPEN), class: "form-select" %> -
+
+

⏱ Timer

+ <% if @running_entry.present? %> +
+
+ Laufender Eintrag: + <%= @running_entry.praktikums_typ %> – <%= @running_entry.entry_art %>
+ Gestartet: <%= l(@running_entry.start_time, format: :short) %>
+ Dauer: Berechne … +
+
+ <%= button_to '⏹️ Stoppen', stop_timer_entry_path(@running_entry), method: :post, class: "btn btn-danger" %> +
+
+ <% end %> -
- <%= label_tag :art, 'Art' %> - <%= select_tag :art, options_for_select(Entry::ENTRY_ARTEN), class: "form-select" %> -
+
-
- <%= submit_tag '▶️ Start', class: "btn btn-success w-100", disabled: @running_entry.present? %> -
-
- <% end %> + <%= form_with url: start_timer_entries_path, method: :post, local: true do %> +
+
+ <%= label_tag :typ, 'Typ' %> + <%= select_tag :typ, options_for_select(Entry::PRAKTIKUMSTYPEN), class: "form-select" %> +
+
+ <%= label_tag :art, 'Art' %> + <%= select_tag :art, options_for_select(Entry::ENTRY_ARTEN), class: "form-select" %> +
+
+ <%= submit_tag '▶️ Start', class: "btn btn-success w-100", disabled: @running_entry.present? %> +
+ <% end %>
- <%= link_to '➕ Neuer Eintrag', new_entry_path, class: 'btn btn-info mt-3 w-100 w-md-auto mb-3' %> +
+<%= link_to '➕ Neuer Eintrag', new_entry_path, class: 'btn btn-info mt-3 w-100 w-md-auto mb-3' %> - -
-

📋 Einträge

-
- -
-
- - + +
+

📋 Einträge

+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + <% @entries.each do |entry| %> - - - - - - - - - - - - - <% @entries.each do |entry| %> - - - - - - - - - - - - - - + + + + + + + + + + + + - - <% end %> - -
DatumZeitTypArtBeschreibungKilometerPauschaleKostenAktionen
DatumZeitTypArtBeschreibungKilometerPauschaleKostenAktionen
<%= entry.date.strftime('%d.%m.%Y') %><%= entry.hours.to_i %>h <%= entry.minutes.to_i %>min - <%= ["Fortbildung", "Semesterkosten"].include?(entry.entry_art) ? entry.entry_art : entry.praktikums_typ.capitalize %> - - <%= ["Fortbildung", "Semesterkosten"].include?(entry.entry_art) ? entry.beschreibung : entry.entry_art.capitalize %> - - <%= entry.beschreibung %> - <%= entry.distance_km.to_f %> km - <%= number_to_currency(entry.kilometer_pauschale, unit: "€", separator: ",", delimiter: ".") %> - - <%= number_to_currency(entry.kosten, unit: "€", separator: ",", delimiter: ".") %> - -
+
<%= entry.date.strftime('%d.%m.%Y') %><%= entry.hours.to_i %>h <%= entry.minutes.to_i %>min + <%= ["Fortbildung", "Semesterkosten"].include?(entry.entry_art) ? entry.entry_art : entry.praktikums_typ.capitalize %> + + <%= ["Fortbildung", "Semesterkosten"].include?(entry.entry_art) ? entry.beschreibung : entry.entry_art.capitalize %> + + <%= entry.beschreibung %> + <%= entry.distance_km.to_f %> km + <%= number_to_currency(entry.kilometer_pauschale, unit: "€", separator: ",", delimiter: ".") %> + + <%= number_to_currency(entry.kosten, unit: "€", separator: ",", delimiter: ".") %> + +
<%= link_to 'Bearbeiten', edit_entry_path(entry), class: 'btn btn-sm btn-outline-primary' %> <%= link_to 'Löschen', entry_path(entry), class: 'btn btn-sm btn-outline-danger open-delete-modal' %> -
-
-
- <%= link_to "Export als CSV", export_csv_entries_path(format: :csv), class: "btn btn-outline-secondary mt-3 w-100 w-md-auto" %> +
+ + + <% end %> + +
+ <%= link_to "Export als CSV", export_csv_entries_path(format: :csv), class: "btn btn-outline-secondary mt-3 w-100 w-md-auto" %> +