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-05-02 17:44:50 +02:00

46 lines
1.8 KiB
Plaintext

<tr id="meal-<%= m.id %>" class="primary meal project idnt idnt-1"
style="background-color: #d0e0e3;">
<td class="name unwrappable" style="border-right: none;">
<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-time"} %>
<% end %>
</td>
<td id="notes-links-<%= m.id %>" class="unwrappable"
style="text-align: left; border-left: none; border-right: none; width: 1%;">
<%= 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" %>
</td>
<% if false %>
<td id="notes-<%= m.id %>" class="notes unwrappable" colspan="<%= @quantities.length + 1 %>"
style="text-align: left; border-left: none;">
<%= notes(m) %>
</td>
<% end %>
<td class="value ellipsible" style="border-left: none;"></td>
<% @quantities.each do |q| %>
<td class="value ellipsible">
<%= format_value(@nutrient_summary[q][m], @nutrients[q][:precision]) %>
</td>
<% end %>
<td class="action unwrappable" style="width: 1%;"><%= meal_links(m) %></td>
</tr>