1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/views/meals/_show.html.erb
2020-04-19 21:50:59 +02:00

30 lines
1.1 KiB
Plaintext

<tr id="meal-<%= m.id %>" class="primary meal project idnt idnt-1">
<td class="name unwrappable" style="width: 5%;">
<b><%= "#{t '.label_meal'} ##{index+1}" %></b>
<% 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-ok"} %>
<% end %>
<td id="notes-<%= m.id %>" class="notes" style="text-align: left;">
<%= display_notes(m) %>
</td>
<td class="action" style="width: 5%;"><%= meal_links(m) %></td>
</td>
</tr>
<% m.ingredients.each do |i| %>
<tr id="ingredient-<%= i.id %>" class="ingredient project idnt idnt-2 buttonable">
<td class="name unwrappable" style="width: 5%;">
<%= i.food.name %>
</td>
<td class="amount unwrappable" style="text-align: left;" colspan="2">
<%= adjust_ingredient_links(i) { raw "&emsp;<span>#{i.amount}</span>&emsp;" } %>
</td>
</tr>
<% end %>
</tr>