<%= link_to t.name.presence || "Objectif ##{t.id}", t %>
|
<% if t.target_allocations.empty? %>
Aucune répartition définie
<% else %>
<% t.target_allocations.each do |a| %>
-
<%= a.nutrient_profile&.name || "Profil ##{a.nutrient_profile_id}" %>
— <%= number_with_precision(a.percentage.to_f, precision: 2) %>%
<% end %>
<% end %>
|
<%= number_with_precision(sum_pct, precision: 2) %>%
|
<%= l(t.created_at, format: :short) %>
|
<%= link_to "Voir", t, class: "btn btn-outline-secondary btn-sm" %>
<%= link_to "Modifier", edit_target_path(t), class: "btn btn-outline-primary btn-sm" %>
<%# FIXME: Doesn't work. %>
<%= link_to "Supprimer", t, class: "btn btn-outline-danger btn-sm",
data: { turbo_method: :delete, turbo_confirm: "Supprimer cet objectif ?" } %>
|
<% end %>
<% else %>