Displaying date summary
This commit is contained in:
parent
f6a7f0219e
commit
dafebdc529
@ -10,14 +10,12 @@
|
|||||||
<% total_width = 4 + @quantities.length %>
|
<% total_width = 4 + @quantities.length %>
|
||||||
<% @meals_by_date.reverse_each do |date, meals| %>
|
<% @meals_by_date.reverse_each do |date, meals| %>
|
||||||
<tr id="date-<%= date.strftime('%Y%m%d') %>" class="date">
|
<tr id="date-<%= date.strftime('%Y%m%d') %>" class="date">
|
||||||
<td class="date" colspan="2" style="width:<%= 3 * 100/total_width %>%" rowspan="2">
|
<td colspan="2" rowspan="2" style="width:<%= 3 * 100/total_width %>%"></td>
|
||||||
<h3><%= date == Date.current ? 'Today' : date.strftime('%F') %></h3>
|
|
||||||
</td>
|
|
||||||
<td class="quantityhead" style="width:<%= 100/total_width %>%;">
|
<td class="quantityhead" style="width:<%= 100/total_width %>%;">
|
||||||
<%= l(:field_amount) %>
|
<%= l(:field_amount) %>
|
||||||
</td>
|
</td>
|
||||||
<% @quantities.each do |q| %>
|
<% @quantities.each do |q| %>
|
||||||
<td class="quantityhead closable" style="width: <%= 100/total_width %>%;"
|
<td class="quantityhead" style="width: <%= 100/total_width %>%;"
|
||||||
title="<%= q.description %>">
|
title="<%= q.description %>">
|
||||||
<%= q.name %>
|
<%= q.name %>
|
||||||
</td>
|
</td>
|
||||||
@ -26,15 +24,24 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="quantityhead" style="width:<%= 100/total_width %>%;">
|
<td class="quantityhead"><%= "[#{@amount_mfu_unit.shortname}]" %></td>
|
||||||
<%= "[#{@amount_mfu_unit.shortname}]" %>
|
|
||||||
</td>
|
|
||||||
<% @quantities.each do |q| %>
|
<% @quantities.each do |q| %>
|
||||||
<td class="quantityhead" style="width: <%= 100/total_width %>%;">
|
<% mfu_unit = @nutrients[q][:mfu_unit] %>
|
||||||
<% mfu_unit = @nutrients[q][:mfu_unit] %>
|
<td class="quantityhead"><%= "[#{mfu_unit ? mfu_unit.shortname : '-'}]" %></td>
|
||||||
<%= "[#{mfu_unit ? mfu_unit.shortname : '-'}]" %>
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="date" colspan="2">
|
||||||
|
<h3><%= date == Date.current ? 'Today' : date.strftime('%F') %></h3>
|
||||||
|
</td>
|
||||||
|
<td class="value ellipsible"></td>
|
||||||
|
<% @quantities.each do |q| %>
|
||||||
|
<td class="value ellipsible">
|
||||||
|
<%= format_value(@nutrient_summary[q][date], @nutrients[q][:precision]) %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% meals.each_with_index do |m, index| %>
|
<% meals.each_with_index do |m, index| %>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<%= notes(m) %>
|
<%= notes(m) %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td class="value ellipsible"></td>
|
<td class="value ellipsible"></td>
|
||||||
<% @quantities.each do |q| %>
|
<% @quantities.each do |q| %>
|
||||||
<td class="value ellipsible">
|
<td class="value ellipsible">
|
||||||
<%= format_value(@nutrient_summary[q][m], @nutrients[q][:precision]) %>
|
<%= format_value(@nutrient_summary[q][m], @nutrients[q][:precision]) %>
|
||||||
|
Reference in New Issue
Block a user