1
0

Styling changes

This commit is contained in:
cryptogopher 2020-05-02 14:50:42 +02:00
parent 54fc7ecf7e
commit 1734910d10
3 changed files with 9 additions and 13 deletions

View File

@ -10,7 +10,8 @@
<% 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 colspan="2" rowspan="2" style="width:<%= 3 * 100/total_width %>%"></td> <td colspan="2" rowspan="2"
style="width:<%= 3 * 100/total_width %>%; border: none;"></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>
@ -20,7 +21,7 @@
<%= q.name %> <%= q.name %>
</td> </td>
<% end %> <% end %>
<td style="width:<%= 100/total_width %>%"></td> <td rowspan="2" style="width:<%= 100/total_width %>%; border: none;"></td>
</tr> </tr>
<tr> <tr>
@ -31,8 +32,8 @@
<% end %> <% end %>
</tr> </tr>
<tr style="border: solid 2px #d9ead3;"> <tr style="background-color: #fff2cc;">
<td class="date" colspan="2" style="background-color: #d9ead3;"> <td class="date" colspan="2">
<h3 style="margin: 0;"> <h3 style="margin: 0;">
<%= date == Date.current ? 'Today' : date.strftime('%F') %> <%= date == Date.current ? 'Today' : date.strftime('%F') %>
</h3> </h3>
@ -47,12 +48,8 @@
</tr> </tr>
<% meals.each_with_index do |m, index| %> <% meals.each_with_index do |m, index| %>
<%= render partial: 'meals/show', locals: { <%= render partial: 'meals/show', locals: {m: m, index: index, color: '#d0e0e3'} %>
m: m, index: index,
color: cycle('#d0e0e3', '#c9daf8', '#cfe2f3', '#d9d2e9', '#ead1dc')
} %>
<% end %> <% end %>
<% reset_cycle %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@ -1,6 +1,6 @@
<tr id="meal-<%= m.id %>" class="primary meal project idnt idnt-1" <tr id="meal-<%= m.id %>" class="primary meal project idnt idnt-1"
style="border: solid 2px <%= color %>;"> style="background-color: <%= color %>;">
<td class="name unwrappable" style="background-color: <%= color %>;"> <td class="name unwrappable">
<b><%= "#{t '.label_meal'} ##{index+1}" %></b> <b><%= "#{t '.label_meal'} ##{index+1}" %></b>
<% if m.eaten_at %> <% if m.eaten_at %>
<%= " at #{m.eaten_at.strftime('%R')}" %> <%= " at #{m.eaten_at.strftime('%R')}" %>

View File

@ -11,6 +11,7 @@ table.list .quantityhead {
vertical-align: bottom; vertical-align: bottom;
position: relative; position: relative;
padding: 2px 0; padding: 2px 0;
border: none;
} }
table.list .action, table.list .action,
@ -31,8 +32,6 @@ table.list td.form {
text-align: left; text-align: left;
} }
table#meals, table#meals td {border: none;}
fieldset#filters table.filter td {padding-left: 8px;} fieldset#filters table.filter td {padding-left: 8px;}
a.icon:not(.icon-move) {margin-left: 0.3em;} a.icon:not(.icon-move) {margin-left: 0.3em;}