<%= render partial: 'ingredients/filters', locals: {url: filter_project_ingredients_path(@project, view_mode: current_view)} %> <% if @ingredients.any? %> <%= render partial: 'ingredients/options' %> <%= error_messages_for @formula_q.formula, *@quantities.map { |q| q.formula } %> <% total_width = 4 + @quantities.length %> <% @quantities.each do |q| %> <% end %> <% @ingredients.each_with_index do |i, index| %> <% row_class = "ingredient#{' hidden' if i.hidden} #{cycle('odd', 'even')}" %> <% @requested_n[index].each do |*, value| %> <% end %> <% if @quantities.length > 0 rows = (@extra_n[index].length - 1) / @quantities.length + 2 else rows = 1 end %> <% @requested_n[index].each do |q_name, value| %> <% end %> <% next unless @quantities.length > 0 %> <% @extra_n[index].each_slice(@quantities.length) do |values| %> <% values.each do |q_name, value| %> <% end %> <% if @quantities.length > values.length %> <% end %> <% end %> <% end %>
<%= l(:field_name) %>
<%= link_to '', toggle_column_project_ingredients_path(@project, quantity_id: q.id, view_mode: current_view), {class: "icon icon-close", method: :post, remote: true} %>
<%= q.name %>
<%= l(:field_action) %>
<%= i.name %> <%= format_value(value) %><%= action_links(i) %>
<% else %>

<%= l(:label_no_data) %>

<% end %>