%= error_messages_for *@targets %>
<%= render partial: 'goals/show_form', locals: {goal_f: goal_f} %>
<%= goal_f.date_field :effective_from, value: @effective_from, disabled: !goal_f.object.is_binding? %>
<% else %> <%= render partial: 'goals/form' %> <% end %><%= goal_f.fields_for :targets, @targets, child_index: '' do |target_f| %> <%= target_f.hidden_field :_destroy %> <%= t ".choose_quantity" %> <%= target_f.select :quantity_id, quantity_options, {include_blank: true, required: true, label: :field_target}, onchange: "showQuantityPath(event);" %> <%= render partial: 'targets/thresholds_form', locals: {target_f: target_f, last_quantity: target_f.object.thresholds.last.quantity} %> <%= link_to t(".button_delete_target"), '#', class: 'icon icon-del', style: (@targets.many? ? "" : "display:none"), onclick: "deleteTarget(); return false;" %> <% end %>
<%= link_to t(".button_new_target"), '#', class: 'icon icon-add', onclick: 'newTarget(); return false;' %>