diff --git a/app/views/entries/_form.html.erb b/app/views/entries/_form.html.erb index 87395cb..6b450ba 100644 --- a/app/views/entries/_form.html.erb +++ b/app/views/entries/_form.html.erb @@ -84,22 +84,15 @@
<%= form.label :praktikums_typ, '🔧 Praktikumstyp', class: 'form-label' %> <%= form.select :praktikums_typ, - ( - current_user.praepedeutikum_abgeschlossen? ? - Entry::PRAKTIKUMSTYPEN.reject { |typ| typ == 'propädeutikum' } : - Entry::PRAKTIKUMSTYPEN - ).map { |typ| [typ.upcase, typ] }, - {}, - class: 'form-select' %> + current_user.praepedeutikum_abgeschlossen? ? + Entry::PRAKTIKUMSTYPEN.reject { |typ| typ == 'propädeutikum' } : + Entry::PRAKTIKUMSTYPEN, + {}, class: 'form-select' %>
<%= form.label :entry_art, '📚 Art', class: 'form-label' %> - <%= form.select :entry_art, - Entry::ENTRY_ARTEN.map { |art| [art.upcase, art] }, - {}, - class: 'form-select', - id: 'entry_art_select' %> + <%= form.select :entry_art, Entry::ENTRY_ARTEN, {}, class: 'form-select', id: 'entry_art_select' %>
diff --git a/app/views/entries/index.html.erb b/app/views/entries/index.html.erb index 002caf5..20928e6 100644 --- a/app/views/entries/index.html.erb +++ b/app/views/entries/index.html.erb @@ -205,30 +205,34 @@
<% end %> -
- <%= label_tag :typ, 'Typ' %> - <%= select_tag :typ, - options_for_select( - ( - current_user.praepedeutikum_abgeschlossen? ? - Entry::PRAKTIKUMSTYPEN.reject { |typ| typ == 'propädeutikum' } : - Entry::PRAKTIKUMSTYPEN - ).map { |typ| [typ.upcase, typ] } - ), - class: "form-select" %> -
+
+ + + <%= form_with url: start_timer_entries_path, method: :post, local: true do %> +
+
+ <%= label_tag :typ, 'Typ' %> + <%= select_tag :typ, + options_for_select( + current_user.praepedeutikum_abgeschlossen? ? + Entry::PRAKTIKUMSTYPEN.reject { |typ| typ == 'propädeutikum' } : + 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 %> -
- <%= label_tag :art, 'Art' %> - <%= select_tag :art, - options_for_select( - Entry::ENTRY_ARTEN.map { |art| [art.upcase, art] } - ), - class: "form-select" %> -
-
- <%= submit_tag '▶️ Start', class: "btn btn-success w-100", disabled: @running_entry.present? %>
@@ -318,7 +322,7 @@ <% if entry.praktikums_typ != 'mediation' %> - <%= ["Fortbildung", "Semesterkosten"].include?(entry.entry_art) ? entry.entry_art : entry.praktikums_typ.capitalize %> + <%= ["Fortbildung", "Semesterkosten"].include?(entry.entry_art) ? entry.entry_art : entry.praktikums_typ.capitalize %> <% else %> <%= entry.praktikums_typ&.capitalize%> <% end %> @@ -356,9 +360,9 @@
<%= link_to 'Bearbeiten', edit_entry_path(entry), class: 'btn btn-sm btn-outline-primary' %>