<%= 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(@filter_q.formula) if @filter_q %> <%= error_messages_for *formulas %> <% total_width = 4 + @quantities.length %> <% @quantities.each do |q| %> <% end %> <% @quantities.each do |q| %> <% end %> <% extra_quantities = @foods.values.first.keys - @quantities %> <% @foods.each do |food, nutrients| %> <% row_class = "food#{' hidden' if food.hidden} #{cycle('odd', 'even')}" %> <% @quantities.each do |q| %> <% end %> <% if @quantities.length > 0 rows = (nutrients.length - 1) / @quantities.length + 1 else rows = 1 end %> <% @quantities.each do |q| %> <% end %> <% next unless @quantities.length > 0 %> <% extra_quantities.each_slice(@quantities.length) do |eqs| %> <% eqs.each do |q| %> <% end %> <% if @quantities.length > eqs.length %> <% end %> <% end %> <% end %>
<%= l(:field_name) %>
<%= link_to '', toggle_exposure_project_foods_path(@project, quantity_id: q.id), {class: "icon icon-close", method: :post, remote: true} %>
<%= q.name %>
<%= l(:field_action) %>
<%= "[#{@food_summary[:mfu_unit][q].try(&:shortname) || '-'}]" %>
<%= food.name %> <%= format_value(nutrients[q], @food_summary[:precision][q], @food_summary[:mfu_unit][q]) %> <%= action_links(food, :nutrients) %>
<% else %>

<%= l(:label_no_data) %>

<% end %>