Profil bearbeiten

<%= render "devise/shared/error_messages", resource: resource %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= f.label :email, "E-Mail", class: "form-label" %> <%= f.email_field :email, class: "form-control" %>

🎯 Zielstunden individuell

<% User::PRAKTIKUMSTYPEN.product(User::ENTRY_ARTEN).each do |(typ, art)| %> <% end %>
Typ Art Zielstunden
<%= typ.capitalize %> <%= art %> <%= number_field_tag( "user[required_hours_matrix][#{typ}][#{art}]", current_user.required_hours_matrix.dig(typ, art), class: "form-control", min: 0 ) %>
Wöchentliche Zielstunden (weekly_target_matrix)
<% User::PRAKTIKUMSTYPEN.product(User::ENTRY_ARTEN).each do |typ, art| %> <% end %>
Typ Art Zielstunden / Woche
<%= typ.capitalize %> <%= art %> <%= number_field_tag( "user[weekly_target_matrix][#{typ}][#{art}]", current_user.weekly_target_matrix.dig(typ, art), class: "form-control", min: 0, step: 0.25 ) %>

🔐 Passwort ändern (optional)

<%= f.label :password, "Neues Passwort", class: "form-label" %> <%= f.password_field :password, autocomplete: "new-password", class: "form-control", placeholder: "••••••••" %>
<%= f.label :password_confirmation, "Passwort bestätigen", class: "form-label" %> <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control" %>
<%= f.label :current_password, "Aktuelles Passwort", class: "form-label" %> <%= f.password_field :current_password, autocomplete: "current-password", class: "form-control" %>
<%= f.submit "Profil aktualisieren", class: "btn btn-primary" %> <% end %> <%= link_to "Zurück", entries_path, class: "btn btn-link mt-3" %>