<%= render partial: 'foods/filters', locals: {url: filter_project_foods_path(@project, view: :nutrients)} %> <% if @foods.any? %> <%= render partial: 'foods/options' %> <% formulas = @quantities.map { |q| q.formula } %> <% formulas.unshift(@formula_q.formula) if @formula_q %> <%= error_messages_for *formulas %> <% total_width = 4 + @quantities.length %> <% @quantities.each do |q| %> <% end %> <% @foods.each_with_index do |f, index| %> <% row_class = "food#{' hidden' if f.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, value| %> <% end %> <% next unless @quantities.length > 0 %> <% @extra_n[index].each_slice(@quantities.length) do |values| %> <% values.each do |q, value| %> <% end %> <% if @quantities.length > values.length %> <% end %> <% end %> <% end %>
<%= l(:field_name) %>
<%= link_to '', toggle_column_project_foods_path(@project, quantity_id: q.id), {class: "icon icon-close", method: :post, remote: true} %>
<%= q.name %>
<%= l(:field_action) %>
<%= f.name %> <%= format_value(value) %><%= action_links(f, :nutrients) %>
<% else %>

<%= l(:label_no_data) %>

<% end %>