<%= "#{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" %> <%= notes(m) %> <%= meal_links(m) %> <% m.ingredients.each do |i| %> <%= i.food.name %> <%= i.amount %>[<%= i.food.ref_unit.shortname %>] <%# Moved to helper to avoid spaces between buttons %> <%= adjustment_buttons(i) %> <% end %>