1
0

Simplified display of readout extended row

This commit is contained in:
cryptogopher 2019-12-21 17:21:47 +01:00
parent 530dba0612
commit d6b3fe3f60
2 changed files with 27 additions and 32 deletions

View File

@ -27,14 +27,11 @@
<td class="date" style="cursor: pointer;" onclick="$(this).closest('tr').prev('tr.primary').toggle(); $(this).closest('tr').prev('tr.primary').nextUntil('tr.primary', 'tr').toggle(); return false;"> <td class="date" style="cursor: pointer;" onclick="$(this).closest('tr').prev('tr.primary').toggle(); $(this).closest('tr').prev('tr.primary').nextUntil('tr.primary', 'tr').toggle(); return false;">
<span class="icon icon-bullet-closed"><%= format_datetime(m) %></span> <span class="icon icon-bullet-closed"><%= format_datetime(m) %></span>
</td> </td>
<% @requested_r[index].each do |q_name, *| %> <% @requested_r[index].each do |q_name, value| %>
<td class="primary quantity"><%= q_name %></td> <td class="primary">
<% end %> <p class="quantity"><%= q_name %></p>
</tr> <p class="value"><%= format_value(value) %></p>
<tr class="<%= row_class %>" style="display:none"> </td>
<td class="space"></td>
<% @requested_r[index].each do |*, value| %>
<td class="primary value"><%= format_value(value) %></td>
<% end %> <% end %>
</tr> </tr>
@ -42,17 +39,11 @@
<% @extra_r[index].each_slice(@quantities.length).with_index do |values| %> <% @extra_r[index].each_slice(@quantities.length).with_index do |values| %>
<tr class="extra <%= row_class %>" style="display:none"> <tr class="extra <%= row_class %>" style="display:none">
<td class="space"></td> <td class="space"></td>
<% values.each do |q_name, *| %> <% values.each do |q_name, value| %>
<td class="extra quantity"><%= q_name %></td> <td class="extra">
<% end %> <p class="quantity"><%= q_name %></p>
<% if @quantities.length > values.length %> <p class="value"><%= format_value(value) %></p>
<td class="space" colspan="<%= @quantities.length-values.length %>"></td> </td>
<% end %>
</tr>
<tr class="extra <%= row_class %>" style="display:none">
<td class="space"></td>
<% values.each do |*, value| %>
<td class="extra value"><%= format_value(value) %></td>
<% end %> <% end %>
<% if @quantities.length > values.length %> <% if @quantities.length > values.length %>
<td class="space" colspan="<%= @quantities.length-values.length %>"></td> <td class="space" colspan="<%= @quantities.length-values.length %>"></td>

View File

@ -1,20 +1,20 @@
table.list tr.quantity.primary td.name {font-weight: bold;} table.list tr.quantity.primary td.name {font-weight: bold;}
table.nutrients.list td.name,
table.nutrients.list td.quantity,
table.readouts.list td.date,
table.readouts.list td.quantity {text-align: left; border-bottom: none;}
table.nutrients.list td.space,
table.readouts.list td.space {border-top: none; border-bottom: none;}
table.nutrients.list td.value,
table.readouts.list td.value {border-top: none;}
table.list tr.ingredient.hidden {opacity: 0.4} table.list tr.ingredient.hidden {opacity: 0.4}
table.list .date,
table.list .name,
table.list .quantity {text-align: left;}
table.list .action,
table.list .value {text-align: right;}
table.list .space {border-top: none; border-bottom: none;}
table.list th,
table.list td.action, table.list td.action,
table.list td.date, table.list td.date,
table.list td.name {white-space: nowrap;} table.list td.name,
table.list td.action,
table.list td.value {text-align: right;}
table.nutrients.list th,
table.nutrients.list td.name,
table.list td.quantity, table.list td.quantity,
table.list td.value { table.list td.value {
overflow: hidden; overflow: hidden;
@ -22,18 +22,22 @@ table.list td.value {
white-space: nowrap; white-space: nowrap;
max-width: 1px; max-width: 1px;
} }
table.list td.form { table.list td.form {
padding-right: 2px; padding-right: 2px;
text-align: left; text-align: left;
} }
fieldset#filters table.filter td {padding-left: 8px;} fieldset#filters table.filter td {padding-left: 8px;}
.icon-move-left { background-image: url(../images/1leftarrow.png); } .icon-move-left { background-image: url(../images/1leftarrow.png); }
.icon-move-right { background-image: url(../images/1rightarrow.png); } .icon-move-right { background-image: url(../images/1rightarrow.png); }
.icon-eye { background-image: url(../images/eye.png); } .icon-eye { background-image: url(../images/eye.png); }
.icon-bullet-open { background-image: url(../../../images/bullet_toggle_minus.png); } .icon-bullet-open { background-image: url(../../../images/bullet_toggle_minus.png); }
.icon-bullet-closed { background-image: url(../../../images/bullet_toggle_plus.png); } .icon-bullet-closed { background-image: url(../../../images/bullet_toggle_plus.png); }
input[type=number] { input[type=number] {
-moz-appearance:textfield; -moz-appearance:textfield;
text-align: right; text-align: right;