You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.6 KiB
89 lines
2.6 KiB
<h2>Profil bearbeiten</h2>
|
|
<%= devise_error_messages! %>
|
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
<div class="mb-3">
|
|
<%= f.label :email, "E-Mail", class: "form-label" %>
|
|
<%= f.email_field :email, class: "form-control" %>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<h3>🎯 Zielstunden individuell</h3>
|
|
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Typ</th>
|
|
<th>Art</th>
|
|
<th>Zielstunden</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% User::PRAKTIKUMSTYPEN.product(User::ENTRY_ARTEN).each do |(typ, art)| %>
|
|
<tr>
|
|
<td><%= typ.capitalize %></td>
|
|
<td><%= art %></td>
|
|
<td>
|
|
<%= number_field_tag(
|
|
"user[required_hours_matrix][#{typ}][#{art}]",
|
|
current_user.required_hours_matrix.dig(typ, art),
|
|
class: "form-control", min: 0
|
|
) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h5 class="mt-4">Wöchentliche Zielstunden (weekly_target_matrix)</h5>
|
|
|
|
<table class="table table-bordered">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Typ</th>
|
|
<th>Art</th>
|
|
<th>Zielstunden / Woche</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% User::PRAKTIKUMSTYPEN.product(User::ENTRY_ARTEN).each do |typ, art| %>
|
|
<tr>
|
|
<td><%= typ.capitalize %></td>
|
|
<td><%= art %></td>
|
|
<td>
|
|
<%= 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
|
|
) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
<h3>🔐 Passwort ändern (optional)</h3>
|
|
|
|
<div class="mb-3">
|
|
<%= f.label :password, "Neues Passwort", class: "form-label" %>
|
|
<%= f.password_field :password, autocomplete: "new-password", class: "form-control", placeholder: "••••••••" %>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<%= f.label :password_confirmation, "Passwort bestätigen", class: "form-label" %>
|
|
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control" %>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<%= f.label :current_password, "Aktuelles Passwort", class: "form-label" %>
|
|
<%= f.password_field :current_password, autocomplete: "current-password", class: "form-control" %>
|
|
</div>
|
|
|
|
<%= f.submit "Profil aktualisieren", class: "btn btn-primary" %>
|
|
<% end %>
|
|
|
|
<%= link_to "Zurück", entries_path, class: "btn btn-link mt-3" %>
|