<%= "#{t '.label_meal'} ##{index+1}" %> <% if m.eaten_at %> <%= " at #{m.eaten_at.strftime('%R')}" %> <%= link_to '', toggle_eaten_meal_path(m), {remote: true, method: :post, class: "icon icon-close"} %> <% else %> <%= link_to l(:button_eat), toggle_eaten_meal_path(m), {remote: true, method: :post, class: "icon icon-time"} %> <% end %> <%= link_to l(:button_cancel), '', class: 'icon icon-cancel', style: 'display: none;', onclick: "$(event.target).closest('tr').find('form').remove(); $('td[id=notes-#{m.id}]').contents().show(); $('td[id=notes-links-#{m.id}] a').toggle(); return false;" %> <%= link_to l(:button_save), '', class: 'icon icon-save', style: 'display: none;', onclick: "$(event.target).closest('tr').find('form').submit(); return false;" %> <%= link_to l(:button_notes), edit_notes_meal_path(m), remote: true, class: "icon icon-wiki-page" %> <% if false %> <%= notes(m) %> <% end %> <% @quantities.each do |q| %> <%= format_value(@nutrient_summary[q][m], @nutrients[q][:precision]) %> <% end %> <%= meal_links(m) %> <% m.ingredients.each do |i| %> <%= i.food.name %> <%= "%g" % i.amount %> <%= "[#{i.food.ref_unit.shortname}]" unless i.food.ref_unit == @amount_mfu_unit %> <% @quantities.each do |q| %> <%= format_value(@nutrients[q][i], @nutrients[q][:precision], @nutrients[q][:mfu_unit]) %> <% end %> <%# Moved to helper to avoid spaces between buttons %> <%= adjustment_buttons(i) %> <% end %>