%= form_with(model: entry, local: true) do |form| %>
<% if entry.errors.any? %>
<%= pluralize(entry.errors.count, "Fehler") %> verhinderten das Speichern:
<% entry.errors.full_messages.each do |msg| %>
- <%= msg %>
<% end %>
<% end %>
<%= form.label :date, 'Datum', class: 'form-label' %>
<%= form.text_field :date,
class: 'form-control flatpickr',
data: { enable_time: false, allow_input: true },
value: (form.object.date || Date.today) %>
<%= form.label :hours, 'Stunden', class: 'form-label' %>
<%= form.number_field :hours,
class: 'form-control',
min: 0,
value: form.object.hours || 0 %>
<%= form.label :minutes, 'Minuten', class: 'form-label' %>
<%= form.number_field :minutes,
class: 'form-control',
min: 0, max: 59,
value: form.object.minutes || 0 %>
<%= form.label :praktikums_typ, 'Praktikumstyp', class: 'form-label' %>
<%= form.select :praktikums_typ, Entry::PRAKTIKUMSTYPEN, {}, class: 'form-select' %>
<%= form.label :entry_art, 'Art', class: 'form-label' %>
<%= form.select :entry_art, Entry::ENTRY_ARTEN, {}, class: 'form-select' %>
<%= form.label :distance_km, 'Entfernung (km) Gesamt', class: 'form-label' %>
<%= form.number_field :distance_km,
class: 'form-control',
min: 0,
value: form.object.distance_km || 0 %>
<%= form.submit 'Speichern', class: 'btn btn-primary' %>
<%= link_to 'Zurück', entries_path, class: 'btn btn-secondary ms-2' %>
<% end %>