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/_index.html.erb
cryptogopher e78803e474 Added MealsController#new and form autocomplete for Food
Renamed QuantityColumn -> Exposure
2020-04-15 23:42:58 +02:00

22 lines
772 B
Plaintext

<% if @meals.any? { |m| m.persisted? } %>
<table id="meals" class="odd-even">
<tbody>
<% @meals.group_by { |m| m.eaten_at.date if m.eaten_at }.each do |d, meals| %>
<% meals.each_with_index do |m, index| %>
<tr id="meal-<%= m.new_record? ? 'new' : m.id %>" class="primary meal">
<td class="name">
<h4>
<%= "#{t '.label_meal'}" %><%= index ? " ##{index+1}" : " (new)" %>
<%= ", #{m.eaten_at.time}" if m.eaten_at %>
</h4>
</td>
<td class="action unwrappable" style="width:5%"><%= action_links(m) %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>