1
0

Add Targets #show

Change css classes from subject-oriented to property-oriented
This commit is contained in:
cryptogopher
2021-05-05 12:42:30 +02:00
parent 8cac724694
commit e301665b6a
22 changed files with 132 additions and 130 deletions

View File

@@ -1,6 +1,6 @@
<tr id="meal-<%= m.id %>" class="primary meal project idnt idnt-1"
style="background-color: #d0e0e3;">
<td class="name unwrappable" style="border-right: none;">
<td class="topleft unwrappable" style="border-right: none;">
<b><%= "#{t '.label_meal'} ##{index+1}" %></b>
<% if m.eaten_at %>
<%= " at #{m.eaten_at.strftime('%R')}" %>
@@ -34,12 +34,12 @@
</td>
<% end %>
<td class="value ellipsible" style="border-left: none;"></td>
<td class="right ellipsible" style="border-left: none;"></td>
<% @quantities.each do |q| %>
<td class="value ellipsible">
<td class="right ellipsible">
<%= format_value(@ingredient_summary[m][q], @ingredient_summary[:precision][q]) %>
</td>
<% end %>
<td class="action unwrappable" style="width: 1%;"><%= meal_links(m) %></td>
<td class="right shrunk unwrappable"><%= meal_links(m) %></td>
</tr>

View File

@@ -1,12 +1,12 @@
<tr id="date-<%= date.strftime('%Y%m%d') %>" class="date" style="background-color: #fff2cc;">
<td class="date" colspan="2" style="border-right: none;">
<td class="topleft" colspan="2" style="border-right: none;">
<h3 style="margin: 0;">
<%= date == Date.current ? 'Today' : date.strftime('%F') %>
</h3>
</td>
<td class="value ellipsible" style="border-left: none;"></td>
<td class="right ellipsible" style="border-left: none;"></td>
<% @quantities.each do |q| %>
<td class="value ellipsible">
<td class="right ellipsible">
<%= format_value(@ingredient_summary[date][q], @ingredient_summary[:precision][q]) %>
</td>
<% end %>

View File

@@ -1,17 +1,15 @@
<tr id="ingredient-<%= i.id %>" class="ingredient project idnt idnt-2 buttonable">
<td class="name ellipsible" colspan="2"><%= i.food.name %></td>
<td class="value ellipsible">
<td class="topleft ellipsible" colspan="2"><%= i.food.name %></td>
<td class="right ellipsible">
<span><%= "%g" % i.amount %></span>
<%= "[#{i.food.ref_unit.shortname}]" unless i.food.ref_unit == @amount_mfu_unit %>
</td>
<% @quantities.each do |q| %>
<td class="value ellipsible">
<td class="right ellipsible">
<%= format_value(@ingredients[i][q], @ingredient_summary[:precision][q],
@ingredient_summary[:mfu_unit][q]) %>
</td>
<% end %>
<td class="action unwrappable" style="width: 1%; text-align: right;">
<%# Moved to helper to avoid spaces between buttons %>
<%= adjustment_buttons(i) %>
</td>
<%# Moved buttons to helper to avoid spaces between buttons %>
<td class="right shrunk unwrappable"><%= adjustment_buttons(i) %></td>
</tr>