47 lines
1.9 KiB
Plaintext
47 lines
1.9 KiB
Plaintext
<tr id="meal-<%= m.id %>" class="primary meal project idnt idnt-1 odd">
|
|
<td class="name unwrappable">
|
|
<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-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>
|
|
<td id="notes-<%= m.id %>" class="notes unwrappable"
|
|
style="text-align: left; border-left: none;">
|
|
<%= notes(m) %>
|
|
</td>
|
|
<td class="action" style="width: 1%;"><%= meal_links(m) %></td>
|
|
</tr>
|
|
|
|
<% m.ingredients.each do |i| %>
|
|
<tr id="ingredient-<%= i.id %>" class="ingredient project idnt idnt-2 buttonable">
|
|
<td class="name unwrappable" colspan="2"><%= i.food.name %></td>
|
|
<td class="amount unwrappable" style="text-align: right;">
|
|
<span><%= i.amount %></span>[<%= i.food.ref_unit.shortname %>]
|
|
</td>
|
|
<td class="unwrappable" style="width: 1%; text-align: right;">
|
|
<%# Moved to helper to avoid spaces between buttons %>
|
|
<%= adjustment_buttons(i) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tr>
|